Project is a person independently developed, Master is the development of the version, v1.0,v1.1,v1.2 ... New development task, from master checkout a new branch out, to develop, when the development finished, I checkout to master, there are a lot of conflicting files, very puzzled, the project is a person I developed, why there is a conflict, in the case of troubleshooting, found that When I was developing on the dev branch, I had to modify a small object on master, and then I made a amend commit, which caused the checkout branch to have the same commit ID as the current commit ID. Therefore, when merging, it was found that two commit IDs were inconsistent, so that all the different files were marked as conflicts instead of merging automatically and need to be merged manually. The solution is to reset the master branch's head pointer to the commit ID at the time of checkout, and then merge to generate a new commit without a conflict.
The reason for this problem is that when checkout a new branch, assume that master's head pointer is 1, the new branch has the latest commit ID of 1, the new branch then adds a lot of commits to the line 1 development, and when Master merges, it just moves the head pointer. However, if Master's head pointer commit ID does not exist on the new branch, Git will assume that someone else has submitted the content (including yourself) in master, and that the head pointer cannot be moved to the head of the new branch simply. You must merge the master's head pointer and the contents of the new branch's head pointer to merge, so once you have a new branch and any commits on the master branch, there will be a conflict when the new branch merges, remember.
git checkout a new branch from the Master branch, and the development is complete merge into master conflicts