How to find the nearest parent of a Git branch?

后端 未结 21 1670
野性不改
野性不改 2020-11-22 00:54

Let\'s say I have the following local repository with a commit tree like this:

master --> a
            \\
             \\
      develop c --> d
               


        
21条回答
  •  無奈伤痛
    2020-11-22 01:20

    I'm not saying this is a good way to solve this problem, however this does seem to work-for-me.

    git branch --contains $(cat .git/ORIG_HEAD) The issue being that cat'ing a file is peeking into the inner working of git so this is not necessarily forwards-compatible (or backwards-compatible).

提交回复
热议问题