是否有 git-merge --dry-run 选项? [英] Is there a git-merge --dry-run option?

查看:16
本文介绍了是否有 git-merge --dry-run 选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在合并一个可能有很多冲突的远程分支.我如何判断它是否会发生冲突?

I'm merging in a remote branch that may have a lot of conflicts. How can I tell if it will have conflicts or not?

我在 git-merge 上没有看到类似 --dry-run 的内容.

I don't see anything like a --dry-run on git-merge.

推荐答案

如前所述,传入 --no-commit 标志,但为了避免快进提交,也传入--no-ff,像这样:

As noted previously, pass in the --no-commit flag, but to avoid a fast-forward commit, also pass in --no-ff, like so:

$ git merge --no-commit --no-ff $BRANCH

检查分阶段更改:

$ git diff --cached

并且您可以撤消合并,即使是快进合并:

And you can undo the merge, even if it is a fast-forward merge:

$ git merge --abort

这篇关于是否有 git-merge --dry-run 选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆