Possible Duplicate:
Git - how to force merge conflict and manual merge on selected file
We're trying to do a merge between two branches: stable code, and new features.
The merge functionality is not working for us: it sometimes shows conflicts, but often just overwrites files without telling us of any conflict, probably with what it thinks is the right version.
Is it possible to block this overwrite so that it shows us all the conflicting lines? We tried using git diff to get an idea of how extensive it was but there are a couple thousand lines because we had pretty extensive debugging on our stable branch...So we'd really need to get the merge functionality working if at all possible.
So we're in a bit of a messy situation, will greatly appreciate all help.
As I do not know how to reproduce your problem, I need to do some guesswork.
In my experience, confusion surrounding git merge can be usually reduced by doing a git pull --rebase
before doing the merge. This pulls in the latest changes from remote, and merges your changes over them. However, do not do this if you intend to merge your changes over an earlier commit. In any case, note down the latest commit ID before doing the pull
, so that you can revert to it if there's a problem.
Now coming to the merge itself, you could try using git merge --no-ff --no-commit
to prevent the merge from being committed. I do not know if this would give you the full conflict report that you would like to see, but it allow you to examine the merge result (like a simulation mode). If you do not like the result, you could revert the merge using git reset --hard
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With