【问题标题】:git cherry shows a new commit as cherry-picked when an identical commit was cherry-picked in the pastgit cherry 在过去选择相同的提交时将新提交显示为已选择的新提交
【发布时间】:2016-01-24 23:03:25
【问题描述】:

假设有两个分支branch1和branch2,并且在两个分支上都有一个test.txt,其中包含以下行“opt:true”。

将两个分支上的值从“true”更改为“false”。

在 branch1 上,将值从“false”更改为“true”并提交。

"git cherry branch2 branch1" 

表明最新的提交不是精心挑选到 branch2 的。

+ dc703edb4cf0f90fa1b5294cc5bea5c63c849229

在 branch1 上,将值从“true”更改为“false”并提交。

"git cherry branch2 branch1" 

表明最新的提交是经过精心挑选的(尽管它不是经过挑选的),因为在 branch2 上已经有一个相同的提交。

/+ dc703edb4cf0f90fa1b5294cc5bea5c63c849229
/- 9d767893962c0dd0d957e2c038bb2ef06df2fee3

有没有办法将 branch1 上未精选到 branch2 的提交的真实列表 git?

【问题讨论】:

  • 您为什么想具体了解哪些是精心挑选的?为什么它们还不够等价?

标签: git cherry-pick git-cherry


【解决方案1】:

有没有办法将 branch1 上未精选到 branch2 的提交的真实列表 git?

git cherry 不会向您显示精选的内容,git 不会记录该信息。它向您显示哪些提交是等效的,哪些不是。它基本上是逐个提交的差异。

git cherry 的目的是让您知道如果您要重新设置基准,哪些提交已被应用或将被应用。从这个意义上说,git cherry 的输出是正确的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-23
    • 1970-01-01
    • 2021-01-18
    • 1970-01-01
    • 2017-12-11
    • 2013-04-21
    • 2015-09-29
    • 2011-09-23
    相关资源
    最近更新 更多