{"id":26013285,"url":"https://github.com/vitberget/git-prompt","last_synced_at":"2026-04-16T23:34:11.841Z","repository":{"id":195012879,"uuid":"692026664","full_name":"vitberget/git-prompt","owner":"vitberget","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-16T11:21:31.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-16T14:04:17.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitberget.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-15T12:00:26.000Z","updated_at":"2024-07-16T11:21:34.000Z","dependencies_parsed_at":"2023-09-23T12:38:51.140Z","dependency_job_id":"7582f5cd-eb98-4945-87d7-d7344c9c0bf4","html_url":"https://github.com/vitberget/git-prompt","commit_stats":null,"previous_names":["vitberget/git-prompt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitberget%2Fgit-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitberget%2Fgit-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitberget%2Fgit-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitberget%2Fgit-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitberget","download_url":"https://codeload.github.com/vitberget/git-prompt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242132936,"owners_count":20077092,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-06T01:35:54.217Z","updated_at":"2026-04-16T23:34:06.787Z","avatar_url":"https://github.com/vitberget.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git prompt\n\n## Install\n\n```sh\ncargo install --path .\n```\n\nShould be installed to `~/.cargo/bin` on Linux.\n\n## Use\n\nGit prompt gives output like output:\n\n```\nexport GIT_PROMPT_BRANCH=main\nexport GIT_PROMPT_INDEX_CHANGED=false\nexport GIT_PROMPT_WORKTREE_CHANGED=false\nexport GIT_PROMPT_REMOTE=different\n```\n\nTo use it in Bash/Zsh/other:\n\n```sh\neval $(git-prompt)\n```\n\n### Zsh example\n\n```zsh\nfunction git-prompt-prompt() {\n    eval $(git-prompt)\n    if [[ ! -z \"$GIT_PROMPT_BRANCH\" ]]; then\n        if [[ \"$GIT_PROMPT_REMOTE\" == \"same\" ]]; then\n            echo -n \"%F{249}\\uE0A0${GIT_PROMPT_BRANCH}\"\n        else\n            echo -n \"%F{160}\\uE0A0%F{249}${GIT_PROMPT_BRANCH}\"\n        fi\n        if [[ \"$GIT_PROMPT_INDEX_CHANGED\" == \"true\" ]]; then\n            echo -n \"%F{red}✗\"\n        else\n            echo -n \"%F{green}✓\"\n        fi\n        if [[ \"$GIT_PROMPT_WORKTREE_CHANGED\" == \"true\" ]]; then\n            echo -n \"%F{red}✗\"\n        else\n            echo -n \"%F{green}✓\"\n        fi\n        echo \" \"\n    fi\n}\n```\n\n## References\n\n### Crate: git2\n\n* \u003chttps://crates.io/crates/git2\u003e\n* \u003chttps://docs.rs/git2/0.18.0/git2/\u003e\n* \u003chttps://github.com/rust-lang/git2-rs\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitberget%2Fgit-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitberget%2Fgit-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitberget%2Fgit-prompt/lists"}