2017-07-15 52 views
1

如何在合并后获得功能分支的所有提交消息(例如开发)?合并后获取功能分支的提交消息

我想:

git log testbranch...develop --pretty=oneline 

,但它不工作。

树: enter image description here

“Commit1” 和 “Commit2” 是 “testbranch”,这是已经合并到开发的提交。

回答

0

可以,很简单的情况下,名单提交访问从testbranch,而不是从develop

git log testbranch ^develop --no-merges --pretty=oneline 

这应该是一样develop..testbranch(两个点,而不是三个)
参见:

如果testbranch已合并回develop,尤其是以快进的方式,则预计会出现空的结果。
含义:一旦一个分支已经快进到另一个,也没有说明一点了:

d---d--t--t--t (testbranch) 
    | 
(develop) 

git checkout develop 
git merge testbranch 

d--d--t--t--t (testbranch, develop) 

你不知道了“其中” testbranch开始。

如果你做了与testbranch分支出来自己(也就是,在你的本地回购)不是很久以前(少于90天),你可以检查出git reflog输出,找回新的testbranch事件的跟踪在<sha1>
请参阅“How do I check git log for a “fast-forward” merge?”。
尝试:

git reflog show testbranch 

然后,知道哪里该分支开始,你可以列出与提交:

git log develop ^<sha1> 

在你的情况,你可能“知道” testbranch开始在commit1,但我点是:Git本身不会知道(除非本地在reflog中,如果该分支创建在本地回购)

+0

我试过'git log testbranch..develop --no-merges --pretty = oneline '但是o utput是空的。 – JaSHin

+0

和'testbranch^develop'?应该也是空的。不要忘记你的问题提到'master',而不是'develop'。你看到'testbranch'中的提交不在开发中吗? 'git branch -vv'是否列出了本地分支(不是远程跟踪分支)'testbranch' *和*'develop'? – VonC

+0

是'testbranch^develop'也是空的。 Testbranch被合并开发(我添加图像到我的问题)。 'git branch -vv'的结果包含两个分支。 – JaSHin

相关问题