+2 votes
1 view
in Devops and Agile by (20k points)
edited by

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.

1 Answer

+3 votes
by (28.4k points)

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

Welcome to Intellipaat Community. Get your technical queries answered by top developers !