我正在尝试编写一些 git 操作的脚本,其中涉及一些 rebase /cherry-picking/等。
有没有一种方法可以解决冲突而不必运行以下命令:
git rebase --continue
git cherry-pick --continue
git merge --continue
我试图避免在 git 需要提交消息时执行编辑器。
也许有一种方法可以告诉 git 事情已经解决并在需要时传递默认提交消息?
最佳答案
您可以使用 git commit -m '$msg'
提交更改,然后发出一条命令“继续执行后续步骤”:
对于 git rebase
:
git commit -m '$msg'
git rebase --skip
对于 git cherry_pick
:
git commit -m '$msg'
# if you are cherry-picking several commits at once,
# this will skip the current (conflicting) one, and proceed with the remaining ones :
git reset
git cherry-pick --continue
对于 git merge
:
没有 git merge --continue
指令。如果发生冲突,您只需修复冲突,然后提交
。所以 git commit -m '$msg'
会这样做。
关于git - 解决 git 与管道命令的冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29590821/