Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+2 votes
2 views
in DevOps and Agile by (19.4k 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 (27.5k 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

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...