git - 解决 git 与管道命令的冲突

标签 git

我正在尝试编写一些 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/

相关文章:

pull/取时 Git 进度观察

git - 忘记使用 `--squash`,现在提交历史一团糟。我怎样才能收拾这个烂摊子?

windows - Bash in Git for Windows : Weirdness when running a command with CMD. exe/C with args

用于计算每个用户包含字符串的提交消息的 Git 命令

git - 寻求单个团队项目下多个 Git 存储库的命名约定

git clone from->to 目录混淆

java - 上传 .jar 文件并运行它。开类类

Git:在最新提交之前还原功能分支中的所有提交

git - 如何不在 git 中显示 .class

java - 将现有的 java (libGDX) 项目和 git 存储库从 eclipse 迁移到 IntelliJ IDEA