git clone https://xx,
git pull
git status
git commit -m " Code submission "
- git push < Remote host name > < Remote branch name >:
git push origin master
git push Tips failed to push some refs"XXX"
Push code error, The reason for the mistake is github Medium README.md The file is not in the local code directory . Obviously , This is because the remote library is not consistent with the local library ,
That is to say, we need to put any file in the remote code base first pull Go to the local code base , can push New code to github In the code base , Next, you can synchronize the remote library to local
git pull --rebase origin master
- This instruction means to merge updates from remote warehouses into local libraries ,–rebase The purpose of this is to cancel the local library commit, And received in the new edition of the library , After the After executing the above code, you can see that there are many in the local code base README.md file
7. Push the submitted code to the main branch
git push -u origin master