:
git log --all BRANCH~1..
, : :
$ git log --graph --oneline --decorate --all
* e3972be (HEAD, a) a-6
* 2707d79 a-5
* cdea9a7 a-4
| * 65b716e (c) c-5
| * ebe2a0e c-4
|/
| * 2ed9abe (b) b-4
|/
* ace558e (master) 3
* 20db61f 2
* 3923af1 1
--all, : master → HEAD:
$ git log --graph --oneline --decorate master..
* e3972be (HEAD, a) a-6
* 2707d79 a-5
* cdea9a7 a-4
, , , :
$ git log --graph --oneline --decorate --all master..
* e3972be (HEAD, a) a-6
* 2707d79 a-5
* cdea9a7 a-4
* 65b716e (c) c-5
* ebe2a0e c-4
* 2ed9abe (b) b-4
, , , , , . log master :
$ git log --graph --oneline --decorate --all master~1..
* e3972be (HEAD, a) a-6
* 2707d79 a-5
* cdea9a7 a-4
| * 65b716e (c) c-5
| * ebe2a0e c-4
|/
| * 2ed9abe (b) b-4
|/
* ace558e (master) 3
-! ( , , : git 1.7.1)
EDIT 2017-11-17. STW : . , master, . , :
$ git checkout
Switched to a new branch 'z'
$ git commit
[z (root-commit) bc0c0bb] z-1
$ git commit
[z 1183713] z-2
$ git log
* 1183713 (HEAD -> z) z-2
* bc0c0bb z-1
* 6069f73 (a) a-6
* 654d106 a-5
* a218c59 a-4
| * 338432a (c) c-5
| * 2115318 c-4
|/
| * 43a34dc (b) b-4
|/
* ce05471 (master) 3
The branch z, created as an orphan, has no common history with master, z-1and therefore z-2should be excluded, but were not. This is what for --ancestry-path, now I get. Inclusion in it excludes the branch z:
$ git log --graph --oneline --decorate --all --ancestry-path master~1..
* 6069f73 (a) a-6
* 654d106 a-5
* a218c59 a-4
| * 338432a (c) c-5
| * 2115318 c-4
|/
| * 43a34dc (b) b-4
|/
* ce05471 (master) 3
For completeness, even if it already has one --ancestry-path, the current top answer does not show the branch relation correctly, because it excludes fixing to masteritself:
$ git log --graph --oneline --decorate --all --ancestry-path master..
* 6069f73 (a) a-6
* 654d106 a-5
* a218c59 a-4
* 338432a (c) c-5
* 2115318 c-4
* 43a34dc (b) b-4