Today, when you pull the server's code to local with Git pulls, you encounter an error, Your local changes to the following files would is overwritten by merge:, you can use the following methods to resolve:
Method 1: If you want to keep the code that you have just modified locally and pull the code on the GIT server locally (the code you just modified will be temporarily locked up)
Git Stashgit pull Origin mastergit stash Pop
As a result, the code on the server is updated locally, and your locally modified code is not overwritten, and the local code is updated to the server using the Add,commit,push command.
Method 2, if you want to completely overwrite the local code, leaving only the server-side code, then directly fall back to the previous version, and then pull:
Git reset--Hardgit pull Origin Master
Note: Where Origin master represents the main branch of Git.
Git pull encountered an error: Error:your local changes to the following files would is overwritten by merge: