[英]How can i Cherry pick a commit of another branch using TortoiseGit without committing?
I can cherry pick a commit using bash 我可以使用bash挑选提交
git cherry-pick -n <HASH>
But is there any way to do that by using TortoiseGit? 但是,有什么办法可以使用TortoiseGit吗?
Checkout the branch on which you want to cherry pick the commit it. 签出要在其上进行选择的分支。 Then 然后
Now you basically have two options as the -n
option is not directly available in TortoiseGit. 现在,您基本上有了两个选项,因为-n
选项在TortoiseGit中不直接可用。
1) Change the cherry-pick type from "Pick" to "Edit", start the cherry-pick and then, check the "Edit commit" checkbox, keep the commit dialog open, do your changes and then commit and finish the cherry-pick. 1)将cherry-pick类型从“ Pick”更改为“ Edit”,启动cherry-pick,然后选中“ Edit commit”复选框,保持commit对话框打开,进行更改,然后提交并完成cherry-挑。
2) Finish the cherry pick and then 2)完成樱桃摘,然后
cf. cf. https://tortoisegit.org/docs/tortoisegit/tgit-dug-cherrypick.html https://tortoisegit.org/docs/tortoisegit/tgit-dug-cherrypick.html
Suppose you want to cherry-pick Commit X from dev
to master
. 假设您想将Commit X从dev
挑选到master
。
master
and press OK. 右键单击存储库,然后选择TortoiseGit->切换/签出->选择master
,然后按OK。 dev
-> Show log. 右键单击存储库,然后选择TortoiseGit->浏览参考->右键单击dev
>显示日志。 -n
, we can do a mixed reset back to the previous commit to simulate -n
. 由于cherry-pick菜单不支持选项-n
,我们可以将混合重置返回到先前的提交,以模拟-n
。 TortoiseGit -> Browse references -> Right click on master
-> Show log -> Right click on the previous commit -> Reset "master" to this... -> Press OK. TortoiseGit->浏览参考->右键单击master
>显示日志->右键单击上一个提交->将“ master”重置为此...->按OK。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.