Sunday, January 20, 2013

How to show git branch/status information in bash

extension for terminal/command line to use git more effectively:

For Mac users, (zsh): https://github.com/olivierverdier/zsh-git-prompt

For bash(works fine for Ubuntu): https://github.com/magicmonty/bash-git-prompt
I do following update for /home/USER/.bash/gitprompt.sh :
PROMPT_START="$WHITE$Time12a $Yellow$PathShort$ResetColor"
PROMPT_END=" $ "

For simple branch show(works very fast), (link second comment):
Simply add following line it ~/.bashrc
PS1='[\u@\h`__git_ps1` \W]\$ '



No comments:

Post a Comment