I am going through git branching concepts from 3.1 Git Branching - Branches in a Nutshell
I am playing with dummy repository.
git log --oneline --decorate gives following output.
$ git log --oneline --decorate
d0006a6 (HEAD, origin, tag: Test1, origin/master, origin/HEAD, master) Minor change
1437545 Minor change
69a948a Added Makefile
617ffeb Spell correction
6bf9b3f First commit
$ git branch
* master
$ git remote --v
origin /home/adil/work/git/repo/ (fetch)
origin /home/adil/work/git/repo/ (push)
I am not clear with multiple entries with origin and master. Like origin, origin/master, origin/HEAD, master
The sample output in the URL gives:
f30ab (HEAD, master, testing) add feature #32 - ability to add new
Similarly I was expecting the output to be:
d0006a6 (HEAD, tag: Test1, master) Minor change
One thing could be difference point is, in our case, its having remote. So I think that's why origin is coming but why origin, origin/master, origin/HEAD 3 extra entries?
This is something fundamental you have to understand about git.
origin is your remote. It can be named anything else, but the main remote is named origin by convention
origin/master is your main or master branch in the remote named origin. Again the name master is simply convention and it can be anything else.
origin/HEAD is wherever your git is pointing to currently. If you have multiple branches like master and develop, you can checkout to develop. Effectively that action will point HEAD to develop. It is possible to use HEAD like any other branch in git commands. It is just a pointer to what branch you are on currently.
EDIT
Maybe I misunderstood the question, so some more explanation
The three of them are shown so that you know the status of the three things I have explained above.
origin/HEAD at a commit tells you the default branch of origin is pointing to that commitmaster tells you that your local repo is at that particular commitorigin/master tells you that these changes have been pushed to remote and the master branch in your remote is up to date with your local repoIf you had not pushed your changes to remote repo, the origin/HEAD and origin/master would be at the commit that was last pushed to the remote
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