Git is not showing any conflicts, and is overwriting my local copy

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

  • Is there a way to take all changes from one branch during merge conflict in git?
  • How do I show that I'm getting the smallest number of conflicts with Git by using K&R instead of B&D as the coding standard?
  • why git stash cannot abandon the changes made just now?
  • Merge two reformatted PHP files with GIT
  • Git: get $REMOTE, $BASE and $LOCAL files when fixing merge conflicts
  • How do I fix a merge conflict due to removal of a file in a branch?
  • Is there any tool for me to easy understand the git conflict file?
  • How to resolve merge conflicts in Git?
  • 2 Solutions collect form web for “Git is not showing any conflicts, and is overwriting my local copy”

    git pull without argument is, more or less, equivalent to git fetch && git merge origin/<upstream_branch>. 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/<branch> ;# diff your local branch with the remote's copy of <branch>

    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/<branch>, then issue git diff --cached. That’ll show you exactly what changes git merged automatically, and should allow you to determine what’s what.

    If git manages to resolve all the conflicts during a git pull then it will make a commit. This doesn’t mean that it necessarily got things right. As you’ve noticed, depending on the changes you may need to do some manual fix-ups.

    To do this, make the corrections in your working tree after your pull, then stage them (e.g. with git add -u) and amend the merge commit with git commit --amend.

    This will make a new merge commit which replaces the one that git made with one including your corrections.

    You can then push the results as you usually do.

    Git Baby is a git and github fan, let's start git clone.