git clone https://xx,
git pull
![](/img/21/71dc6cbf0003975f5edca1df3f41f7.jpg)
git status
![](/img/25/c98c416c13a317bfe25e6963377db8.jpg)
![](/img/31/10f9039ef4e9ac173234fe6bba65d1.jpg)
git commit -m " Code submission "
![](/img/4f/5df647a1f873b30dc5bb914dc8ceed.jpg)
- 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