How to find which git branch I am on when my disk is mounted on other server

The Solution to How to find which git branch I am on when my disk is mounted on other server is


git branch with no arguments displays the current branch marked with an asterisk in front of it:

[email protected]:~/gittest$ git branch
* master
  someotherbranch

In order to not have to type this all the time, I can recommend git prompt:

https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh

In the AIX box how I can see that I am using master or inside a particular branch. What changes inside .git that drives which branch I am on?

Git stores the HEAD in the file .git/HEAD. If you're on the master branch, it could look like this:

$ cat .git/HEAD
ref: refs/heads/master

~ Answered on 2011-05-01 01:06:15


Most Viewed Questions: