Skip to content
show submodule/branch/describe info in bash prompt
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
Makefile
README
git

README

SAMPLE OUTPUT
-------------

(b:release-0.2.x d:deploy-pro-2012-03-29) [thomas@otto platform]$ ls
Makefile  platform  puppet  RELEASE-0.2.1
(b:release-0.2.x d:deploy-pro-2012-03-29) [thomas@otto platform]$ cd puppet/pro/
(s:puppet/pro b:release-0.2.x d:v0.2.1) [thomas@otto pro]$

In the first prompt, I'm in the root module, on the release-0.2.x branch,
at a commit described by tag deploy-pro-2012-03-29.
In the last prompt, I went into a submodule, so I'm now in
submodule puppet/pro, on branch release-0.2.x, described by tag v0.2.1

INSTALL
-------

- run 'make install' as a user to put bash scripts in place
- make sure you source the script in your .bashrc or .bash_profile
  source $HOME/.bashrc.d/git

  (I have these lines in .bashrc to do so:

if test -e ~/.bashrc.d
then
  for f in ~/.bashrc.d/*
  do
    source $f
  done
fi

- set the prompt in your .bashrc or .bash_profile with
  PS1="\$(parse_git_branch)$PS1"
Something went wrong with that request. Please try again.