Reputation: 23492
Is there some good guidelines or mnemonics how to digest git log graph which looks something like this
* 66fa80f (HEAD -> issue) Merge branch 'master' into issue
|\
| * 5215cfa (master) Merge branch 'older'
| |\
| * \ 30e2e4d Merge branch 'older'
| |\ \
| * | | 2256e8e edit quickfix
| * | | aac3274 Merge tag 'iss'
| |\ \ \
| * | | | 89a1904 (tag: mas) master added line and files
* | | | | d93408f Merge branch 'older' into issue
|\ \ \ \ \
| | |_|_|/
| |/| | |
| * | | | 0d8d024 (older) older4
| | |_|/
| |/| |
| * | | 339ce93 older 3
* | | | 71f25e0 Merge commit 'aff67fc' into issue
|\ \ \ \
| |/ / /
| | | /
| |_|/
|/| |
| * | aff67fc older2
| * | c9179a8 older commit 1
* | | 9710daf (tag: iss) issue added line
| |/
|/|
* | b74e3ae quickfix
* | b96ae17 edit README little more
|/
* 4bdbf83 edit readme
* 2fe7b32 (tag: v0.1) Initial commit
It's very hard to see what is going on. Is there some tools or mental tricks to aid comprehending the graph?
Upvotes: 0
Views: 51
Reputation: 9238
A line between commits means that lower commit is a parent of the higher. A commit which has several parents is merge. You may call a commit with several children a "fork", but it is not any special one from git's point of view.
This is what literally the graph means. To discuss how to "comprehend" it further it should be specified which questions you actually want to ask.
In many cases, you should not be comprehending it. Instead, delegate the job to machine, it's good at it. For example if you need to know, if you need to know "if commit C is included to branch B", you issue a command:
git merge-base --is-ancestor C B
And get the answer as exit code. Another example: how to know which commits are included to branch B1 but not to B2. The command is:
git log --oneline B2..B1
And so on...
Upvotes: 1
Reputation: 21600
Keep the graph clean using branching model like git-flow. Essentially, ... before a merge, ... rebase the branch that have to be merged. If the problem is just an ascii view, gitk is the solution. If the problem is that the bundle of branches is simply too intricate, just keep it ordered. ^_^
Upvotes: 0