https://github.com/czarpino/git-branch-prompt
Show current git branch in bash shell prompt
https://github.com/czarpino/git-branch-prompt
bash git
Last synced: 3 months ago
JSON representation
Show current git branch in bash shell prompt
- Host: GitHub
- URL: https://github.com/czarpino/git-branch-prompt
- Owner: czarpino
- License: unlicense
- Created: 2017-11-14T16:56:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-23T14:55:31.000Z (almost 8 years ago)
- Last Synced: 2026-03-31T15:44:42.280Z (3 months ago)
- Topics: bash, git
- Language: Shell
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Update
> Project abandoned due to pointlessness and embarassment. Kept here for posterity.
# Git Branch Prompt
Show current git branch in bash prompt with a thought on performance. Approach is based on basic `git rev-parse` so on a well spec'ed computer optimizations employed here would be completely unnoticeable. For those who do find it noticeable, this is a slightly faster alternative.
## How to
1. Clone the project into `~/.bash`
mkdir ~/.bash
cd ~/.bash
git clone git@github.com:czarpino/git-branch-prompt.git
2. Edit `~/.bash_profile`
source ~/.bash/git-branch-prompt/main.sh
export PS1="\W \[\e[0;36m\]\$git_branch\[\e[0m\]\$ "
3. Open a new terminal or execute `source ~/.bash_profile` for the changes to take effect