Is there a git merge dry run option?
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?
I don't see anything like a --dry-run on git-merge.`
First, pass in the --no-commit flag, but to avoid a fast-forward commit, the following is also recommended:
$ git merge --no-commit --no-ff $BRANCH
Now in order to examine the staged changes:
$ git diff --cached
To undo the merge, even if it is a fast-forward merge:
$ git merge --abort
Note: Git merge will combine multiple sequences of commits into one unified history. In the most frequent use cases, git merge is used to combine two branches.
git merge dry run is used to obtain a summary of what is included by any of the above for the next commit by giving the same set of parameters (options and paths). If you make a commit and then find a mistake immediately after that, you can recover from it with git reset.