{"id":15691025,"url":"https://github.com/parrt/bash-git-prompt","last_synced_at":"2025-05-08T00:45:47.430Z","repository":{"id":20472058,"uuid":"23749617","full_name":"parrt/bash-git-prompt","owner":"parrt","description":"My own variation on the bash git prompt","archived":false,"fork":false,"pushed_at":"2014-09-20T19:26:19.000Z","size":384,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-08T00:45:40.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/parrt.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}},"created_at":"2014-09-07T01:13:52.000Z","updated_at":"2022-05-07T12:45:19.000Z","dependencies_parsed_at":"2022-07-31T21:08:10.553Z","dependency_job_id":null,"html_url":"https://github.com/parrt/bash-git-prompt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrt%2Fbash-git-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrt%2Fbash-git-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrt%2Fbash-git-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parrt%2Fbash-git-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parrt","download_url":"https://codeload.github.com/parrt/bash-git-prompt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252978683,"owners_count":21834913,"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":"2024-10-03T18:19:06.872Z","updated_at":"2025-05-08T00:45:47.403Z","avatar_url":"https://github.com/parrt.png","language":"Python","readme":"bash-git-prompt\n===============\n\n# What/Why?\n\nMy own variation on the bash git prompt. I took much of the ideas\nfrom [magicmonty/bash-git-prompt](https://github.com/magicmonty/bash-git-prompt/blob/master/gitstatus.py). I wanted something simpler in functionality and implementation. Created some functions to organize. Here are some sample prompts:\n\n![parrt prompt](parrt-bash-git-snapshot.png)\n\nIt shows the branch you are on and whether it is clean  or not with a green or yellow branch name (clean means no staged or modified files).\n\nIt shows upward arrow if you are ahead and downward arrow if you are behind or both. Took me forever to figure out that you need to `git fetch` before computing \"behind\" works. :(  Now correctly handles a fetch of remote for each repo every 30 minutes. Stores a small file in repo root: `.fetch_time_cache`.\n\n# Install\n\nYou can put file [`parrt-prompt.py`](https://github.com/parrt/bash-git-prompt/blob/master/parrt-prompt.py) anywhere but that incantation below assumes it's in the `~/.bash` directory. \n\nAdd the following incantation to your `.bash_profile` or `.bashrc`, if you are using that file.\n\n```\nPROMPT_COMMAND='PS1=\"`python ~/.bash/parrt-prompt.py`\"'\n```\n\nIf you want to get fancy, the following variation will also set the title of the window (on OS X at least) to the current working directory.\n\n```\nPROMPT_COMMAND='echo -n -e \"\\033]0;`pwd`\\007\"; PS1=\"`python ~/.bash/parrt-prompt.py`\"'\n```\n\n# Misc\n\nYou might want to update the bash that sits on OS X by default:\n\n```\n$ bash --version\nGNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)\nCopyright (C) 2007 Free Software Foundation, Inc.\n$ brew install bash\n...\n$ bash # launch new shell in this window or open new tab/window.\n$ bash --version\nGNU bash, version 4.3.18(1)-release (x86_64-apple-darwin13.3.0)\nCopyright (C) 2013 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later \u003chttp://gnu.org/licenses/gpl.html\u003e\n\nThis is free software; you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n$\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparrt%2Fbash-git-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparrt%2Fbash-git-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparrt%2Fbash-git-prompt/lists"}