开发者

Find first commit specific to a branch

Looking for commits A(master), C(0.1), K(0.1.1) and O(0.2).

A - B - D - F - G   <- "master" branch (at G)
 \   \        
  \   C - E --M     <- "0.1" branch (still at E)
   \       \
    \       K - L   <- "0.1.1" branch (still at L)
     \
      O - P - F     <- "0.2" branch (still at F)

How can detect this commits by scr开发者_高级运维ipts without user data about parent branch. In other words, how to determine the first commit (A, O, C, K), belongs to a particular branch, knowing only the name of this branch?


Try

git log master..0.1

I think it should display commit C, E and M(is that a commit?)

Edit: The above works only if you have info about the parent branch.

New answer is to try the tool gitk


Try this to get the hash of first commit:

git log <source_branch>..<feature_branch> --pretty=format:%h

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜