Git compare branches


Compare commits

To compare master branch with current HEAD:

$ git log master..HEAD

This is equivalent to:

$ git log master..

To see commits in oneline:

$ git log master.. --oneline

To see commits as a decorated graph:

$ git log master.. --oneline --decorate --graph

Compare code

To see the difference in regards to files modified:

$ git diff master..


If you enjoyed this post, please consider supporting this site!