Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a git-merge --dry-run option?

Tags:

git

git-merge

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.

like image 544
Otto Avatar asked Feb 01 '09 19:02

Otto


1 Answers

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 

To examine the staged changes:

$ git diff --cached 

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

$ git merge --abort 
like image 111
mipadi Avatar answered Sep 20 '22 18:09

mipadi