My routine on git has always been very simple:
git add -A
git commit -m 'the changes I made'
git pull
# resolve conflicts
git push
However, for some unknown reasons, despite lots of conflicts with the origin, after pulling, I don’t get any conflicts and without my permission it force updates my local copy. Something along these lines: ‘2 files changed, 2 insertions(+), 6 deletions(-)’. But in my case, conflicts shouldn’t be resolved from simple merge and should require manual conflict resolution from my side. Why is git not letting me to do the manual conflict resolution? Thanks in advance!
note: none of my git commands have force option -f
git pullwithout argument is, more or less, equivalent togit fetch && git merge origin/<upstream_branch>. By usingpullinstead offetchandmerge, you’re allowing git to attempt the merge into your local branch. If that merge occurs without conflict, your local will look “force updated” because it was able to sort out the differences between the remote’s version of your files and your own, without your intervention.Debugging what’s happening is sort of hard without seeing your code, but try this:
The output from
git diffshould clue you into what’s happening. If you’d like to follow it even further, trygit merge --no-commit origin/<branch>, then issuegit diff --cached. That’ll show you exactly what changes git merged automatically, and should allow you to determine what’s what.