[mythtv] [GIT tip] Git Bash Prompt

Colin Guthrie mythtv at colin.guthr.ie
Fri Jan 21 10:38:03 UTC 2011


Hi,

As some folks are still quite new to git, I thought I'd post this little
tip, that I really love.

I packaged this up in Mandriva, so if you use that platform, just:
 urpmi git-prompt

(NB If other distro packages could provide a similar package that would
be great as it's a useful convenience)

Ultimately all that package does is drop this file:
 /etc/profile.d/93git-branch.sh

but you can equally just add it to your .bashrc.

It shows the current git branch in your command prompt. If you are
mid-merge (i.e. merge conflict), mid-rebase (rebase conflit) or mid
git-am (patch wont apply), it'll indicate it clearly in the prompt
saving you from getting "lost" with regards to the state of your
checkout. It is also very useful when bisecting to find regressions.

I'm sure other some git gurus will have a variation on this already
manually setup up, so they can ignore this message, but hopefully some
users will find it useful.


You can download the file from here:

http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/git/current/SOURCES/93git-branch.sh?view=markup

As you can see it's a really simple snippet :)

HTHs

Col

-- 

Colin Guthrie
myth(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mageia Contributor [http://www.mageia.org/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]


More information about the mythtv-dev mailing list