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 pull without argument is, more or less, equivalent to git fetch && git merge origin/. By using pull instead of fetch and merge, 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:
git fetch ;# fetch the remote changes
git diff HEAD origin/ ;# diff your local branch with the remote's copy of
The output from git diff should clue you into what's happening. If you'd like to follow it even further, try git merge --no-commit origin/, then issue git diff --cached. That'll show you exactly what changes git merged automatically, and should allow you to determine what's what.