Search code examples
gitgithubgit-log

How to understand crossover Git log?


May anyone tell me what happended between 0ab11dd and bd7278a? And also between 27ac7b7 and 95b2c48? Why there is crossover in those commits?

* xxxxxxx (HEAD -> f-1, origin/f-1) 
* xxxxxxx fix merge conflicts
*   13751d5 Merge branch 'master' into feature/DP-1
|\  
| *   f3efc9d (origin/master, origin/HEAD, master) Merge pull request #9 from fix
| |\  
| | * 83c0b15 (origin/fix) 
| |/  
| *   be24ce6 Merge pull request 
| |\  
| | *   0ab11dd merge
| | |\  
| | |/  
| |/|   
| * |   bd7278a Merge pull request 
| |\ \  
| | * | 14399e2 
| | | * xxxxxxx  
| | | * xxxxxxx 
| | | *   27ac7b7 merge
| | | |\  
| | |_|/  
| |/| |   
| | | * 95b2c48 (origin/f-3) 
| | | * xxxxxxx 

especially this

| | |_|/  
| |/| |   

why there is an out branch but no commit?


Solution

  • About the "crossovers"

    This is just the way the graphic tool represents merges : from right to left (the one on the left being the one "receiving" the merge). So when a commit series (rather than say branch which may be confusing here) has to be merged into another which happens to be currently graphically represented to its right, then the tool draws a line which, yes, crosses the other ones to make its junction to the merge commit from the right.

    So it's just a graphical convention.


    About the vertical lines (after comments)

    Branches are (optionnally, with --decorate) added to the graph at the commit they're currently pointing to, but don't forget that your repo tree doesn't really need any of them. These commit series are the body of your tree, where "branches" are in fact just the tips, that's where the metaphor breaks down a little bit...


    (I grant you that it's a very low-tech representation, ...but let's also admit that informative commit messages would make things way clearer.)