emersonthis emersonthis -4 years ago 76
Git Question

git pull options to prevent merge conflicts

Is there an option(s) when doing

git pull
that will not allow any possibility of a merge conflict? I've looked at the merge strategies but none seem to meet this description. I'm looking for an option like
git pull --quit_if_possible_merge

Basically, want a command for pulling to production site without any risk of a merge conflict which would temporarily bring the site down while we resolve it.

Answer Source

What about:

git pull --ff-only 

If what has been said in the other answers is true, this should have exactly the desired effect. No?

The --ff-only flag stands for "fast-forward" which is how Git refers to a situation in which one of the merging branches contains all of the commits of the other ( a strict superset ). This is special because it means no merge conflicts are possible. The commit so on the branch that is ahead simply get added to other branch and everyone is happy.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download