I was always saved by this alias git:
[alias] tree = log --graph --decorate --pretty=oneline --abbrev-commit
Put it in the ~/.gitconfig
I use this:
$ git tree * 506b39f (HEAD -> test) second at branch * 07c0503 first at branch * f00cb21 first
If I want to see all the commits that have been made in my branch, starting from the point where I split off from master I execute:
git tree master..HEAD * 506b39f (HEAD -> test) second at branch * 07c0503 first at branch
here we see only 2 commits that were made in the test branch and we don’t see commits that were made in the master branch
If you are in the test branch and want to see what has changed in master since you started development, then do (three points !!):
$ git diff test...master diff --git a/test.txt b/test.txt index 8a1218a..eb095b3 100644 --- a/test.txt +++ b/test.txt @@ -1,5 +1,5 @@ -1 -2 +11 +22 3 4 5
And these changes were made by commits (two points !!):
$ git tree test..master * 565b82a (master) thirt at master * 1e408a9 second at master
Changes in these 2 commits:
$ git show 565b82a commit 565b82a6319eb1afa5258bed37b640ec9a782679 Author: Eugen Konkov Date: Mon Oct 24 20:36:39 2016 +0300 thirt at master diff --git a/test.txt b/test.txt index bcba89f..eb095b3 100644 --- a/test.txt +++ b/test.txt @@ -1,5 +1,5 @@ 11 -2 +22 3 4 5 $ git show 1e408a9 commit 1e408a975a52fe9f6c32bd6cd7916c4ac082fd85 Author: Eugen Konkov Date: Mon Oct 24 20:36:27 2016 +0300 second at master diff --git a/test.txt b/test.txt index 8a1218a..bcba89f 100644 --- a/test.txt +++ b/test.txt @@ -1,4 +1,4 @@ -1 +11 2 3 4
And, similarly, all the changes that you made in your test branch, when it was budded from master :
$ git diff master...test diff --git a/test.txt b/test.txt index 8a1218a..ec28619 100644 --- a/test.txt +++ b/test.txt @@ -1,5 +1,5 @@ 1 2 3 -4 -5 +45 +56
or if you are already on the test branch, then you can write HEAD :
$ git diff master...HEAD