Our git repo is on a Linux server; I can be on the master branch or create a new branch that I can go inside and use.
Our git repo disk is mounted on AIX box to build (I can see git directory in the AIX box that allows me to build)
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?
You successfully cloned a Git repository into a specific folder on your server. In this case, you cloned the master branch from your Git remote repository. You can check the current branch cloned by running the “git branch” command.
If you have a single remote repository, then you can omit all arguments. just need to run git fetch , which will retrieve all branches and updates, and after that, run git checkout <branch> which will create a local copy of the branch because all branches are already loaded in your system.
git branch
with no arguments displays the current branch marked with an asterisk in front of it:
user@host:~/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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With