中止git-pick-pick?

本文翻译自:Abort a git cherry-pick?

I ran git cherry-pick <hash> and had merge conflicts. 我运行git cherry-pick <hash>并发生合并冲突。 I don't want to resolve the conflicts, I just want to abort the cherry-pick. 我不想解决冲突,我只是想中止选择。 When doing an actual merge (with git merge ) there's the handy git merge --abort . 在进行实际合并(使用git merge )时,有方便的git merge --abort What's the equivalent for cherry-picking? 摘樱桃等于什么?


#1楼

参考:https://stackoom.com/question/18Zs4/中止git-pick-pick


#2楼

我发现答案是git reset --merge它清除了冲突的选择尝试。


#3楼

You can do the following 您可以执行以下操作

git cherry-pick --abort

From the git cherry-pick docs 来自git cherry-pick文档

 --abort 

Cancel the operation and return to the pre-sequence state. 取消操作并返回到先序状态。


#4楼

对我来说,重置失败的Cherry-Pick-attempt的唯一方法是

git reset --hard HEAD

#5楼

Try also with '--quit' option, which allows you to abort the current operation and further clear the sequencer state. 也可以尝试使用“ --quit”选项,该选项使您可以中止当前操作并进一步清除音序器状态。

--quit Forget about the current operation in progress. --quit忘记当前正在进行的操作。 Can be used to clear the sequencer state after a failed cherry-pick or revert. 失败后,可以用来清除音序器的状态。

--abort Cancel the operation and return to the pre-sequence state. --abort取消操作并返回到先序状态。

use help to see the original doc with more details, $ git help cherry-pick 使用help查看更多细节的原始文档,$ git help cherry-pick

I would avoid 'git reset --hard HEAD' that is too harsh and you might ended up doing some manual work. 我会避免使用'git reset --hard HEAD',它太苛刻了,您可能最终需要做一些手动工作。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值