What does HEAD point to?
I want to compare my local master branch with the remote origin/master branch. I know how to do git pull --rebase; git diff origin/master from my local master branch to detect the line-by-line differences in the code. But, I want to compare the commit histories, i.e., show git log and git log origin/master side-by-side. I tried git show-branch -a but got:
* [master] change content background-color to blue ! [origin/HEAD] add favicon ! [origin/master] add favicon --- * [master] change content background-color to blue *++ [origin/HEAD] add favicon
- Is there a better way?
- Also, what does HEAD point to, the checked-out commit?
You could do:
git log master..origin/master
to list the commits that are "between" master and origin/master.
HEAD points to the checked out commit.
Both the dot-dot syntax and HEAD are documented at gitrevisions(7).
Is there a better way...
to detect the line-by-line differences in the code?
git diff origin/master..master
to compare the commit histories?
git log origin/master..master
Also, what does HEAD point to, the checked-out commit?
HEAD points to the "tip" of the current "branch".