为什么 git-cherrypick 没有说要提交
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14096244/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
why is git-cherrypick saying nothing to commit
提问by user1934146
I googled a lot for the below issue but couldn't get any substantial info...please help me out,created a temporary branch 202116 and am trying to do a cherrypick of gerrit 202116 and I get the below message,why am I not able to cherry-pick this gerrit and why am I getting this error?please provide your inputs
我在谷歌上搜索了很多关于下面的问题,但没有得到任何实质性的信息......请帮助我,创建一个临时分支 202116 并且我正在尝试挑选 gerrit 202116 并且我收到以下消息,为什么我没有能够挑选这个gerrit,为什么我会收到这个错误?请提供您的意见
<>git fetch ssh://[email protected]:29418/platform/vendor/company-proprietary/radio refs/changes/25/202116/1 && git cherry-pick FETCH_HEAD
From ssh://company.com:29418/platform/vendor/company-proprietary/radio
* branch refs/changes/25/206025/1 -> FETCH_HEAD
# On branch 202116
# You are currently cherry-picking.
# (all conflicts fixed: run "git commit")
#
nothing to commit, working directory clean
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:
git commit --allow-empty
回答by Ryan Stewart
It's exactly what it says: the changes you're trying to cherry-pick are already wholly contained in the branch you're on. I.e. the result of the cherry-pick is no changes. You can create an empty commit with the --allow-empty
flag to indicate that you attempted to cherry-pick, but there were no changes to pull in.
这正是它所说的:您尝试挑选的更改已经完全包含在您所在的分支中。即樱桃挑选的结果是没有变化。您可以创建一个带有--allow-empty
标志的空提交,以表明您尝试挑选,但没有任何更改可以引入。
回答by pktangyue
I don't know why you do a cherry-pick
after fetch
, Because you may cherry-pick the same commit with your HEAD
.
我不知道你为什么要做cherry-pick
after fetch
,因为你可能会用你的HEAD
.
And is git checkout
what you really want? I guess.
而git checkout
这真的是你想要的吗?我猜。
回答by Hassen Ch.
This could be caused by trying to cherry pick a commit that was already integrated/cherry-picked into your current branch.
这可能是由于尝试挑选已经集成/挑选到当前分支中的提交造成的。
回答by Fiskabollen
I got this message when I misread my Bitbucket diff page, mistaking the parent commitfor the commit I wanted. Thus I was attempting to cherry-pick the parent commit which was already on my working branch - so there was indeed "nothing to commit".
当我误读我的 Bitbucket 差异页面,将父提交误认为我想要的提交时,我收到了这条消息。因此,我试图挑选已经在我的工作分支上的父提交 - 所以确实“没有什么可提交的”。