git pull code and common errors

1. Update the code

git pull

2. Merge the code of the master branch into your own branch

First switch to the master branch: git checkout master

Pull the code of the main branch: git pull

Go back to your own branch: git checkout xxx

Merge code: git merge master

3. An error may be reported during git pull: error: Your local changes to the following files would be overwritten by merge:

Solution: Save the code you just modified, and pull the code on the git server to the local

git stash
git pull origin master
git stash pop

Guess you like

Origin blog.csdn.net/m0_58991732/article/details/131315659