Home

Beautify your Git Prompt

Hmm..so you like to modify your terminal’s prompt for Git to look like mine haan!

No problemo…

Beautify Prompt for Git

Modifying the prompt will only work for your directories which are using Git. The modified prompt will save you time by presenting following information in just a glance:

Steps:

$ curl -o ~/.git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh

If file mentioned above does not exist, you may contact me. I will send you the file. 🙂

source ~/.git-prompt.sh

export PS1=’\[\033[01;32m\]vm \[\033[01;34m\]\w $(__git_ps1 “[%s]”)\$\[\033[00m\] ‘

export GIT_PS1_SHOWDIRTYSTATE=1

export GIT_PS1_SHOWUPSTREAM=”auto”

Feel free to change “vm” to some other string like your cat’s name in the PS1 variable. This string appears in the prompt (as you may see from screenshot above).

Hope you find this useful. 🙂



Subscribe: rss | email