gitgit-merge-conflict

After git pull, some files are marked as changed in local which are actually behind server


The problem occurs in different people of this repo, the symptom is when someone git pull, there will be a lot of changes in pending changes, which are not really his change. These files actually are changed by others and checked in, but somehow git recognize this unchanged local version is latest. It's quite annoying.

How does this happen?


Solution

  • It turned out that because the guy is using squash commit to complete his PR while his PR had some merged changes with other people.

    Then next time he try to pull the main branch and merge it into his local change, git bring all the merged changes back again because squash had removed all the commit hash.