I can’t figure out why git show-branch isn’t giving me the same full history that git log –graph shows me. Why would the following discrepancy occur?
$ git log --graph --oneline --date-order
* 786c9bd Merge branch 'master' into testbr
|\
* | dda9989 ch2 to couch
* | 05d0851 chg 1 to couch
| * 3df86c2 change 1 to tv
| * 900ad58 added tv
|/
* 76352a8 mess
$ git show-branch
! [master] change 1 to tv
* [testbr] Merge branch 'master' into testbr
--
- [testbr] Merge branch 'master' into testbr
+* [master] change 1 to tv
Further, if I create a new branch (see below), then git show-branch gives the output I expect.
$ git branch foo testbr~3
$ git show-branch
! [foo] mess
! [master] change 1 to tv
* [testbr] Merge branch 'master' into testbr
---
- [testbr] Merge branch 'master' into testbr
+* [master] change 1 to tv
+* [master^] added tv
* [testbr^] ch2 to couch
* [testbr~2] chg 1 to couch
++* [foo] mess
Compared to
git log,git show-branchonly shows:HEADthat is ‘*‘ andnon-HEAD: ‘!‘ which have a relation with HEAD)--‘):*‘ commits fromHEADbranch+‘ commits fromnon-HEADbranches*+‘ commits fromnon-HEADbranches also part ofHEADbranch-‘ merge commitsand their commits), not all commits.
The fact that your second example looks like the initial
git logonly means that those commits displayed in the second show-branch are linked to theHEADbranch, making them close of a classic commit graph (which git log produces)