Today I made a very elementary mistake when I used Git to commit code. I followed all the procedures when I added and committed code, and finally used push to remote repository.

Then something strange happened. After the push, a look at the remote repository code found no commit record, emmmm~

I’m not calm right now. What the fuck? What happened to the code I submitted?

Just at this time, catch up with the operation and maintenance of the upgrade server, thinking that the server is a problem, such as server upgrade to try again.

MD, when the server is upgraded, push again cannot see the submission record in the remote warehouse. Use git-log locally to check the submission record.

Shit, this is the submission record, what a ghost oh!

I can’t help it. I asked my colleague to come over and take a look, but still there is no content to push again. In this case, I will leave the local code as it is

Make a change, submit it and push it to see if it works, and there it is. Oh, my God. Push code rejected emmmm…

The hint above is already obvious. It basically means that the current branch is behind the remote branch. Pull before pushing the code, but let’s see

I remember that I usually pull before I push, and then I asked my colleague to know that in git pull, by default, I do not know which remote branch you want to pull.

Git pull origin data_center_update git pull origin data_center_update

Finally, to sum up

I really made a very elementary mistake, and there was no need to write a separate blog, but I think this kind of problem can’t happen again in the future, so I want to remind myself,

Record in the blog, such problems in the future, to be careful and careful again.

Statement: Original article, reproduced please indicate the source, thank you! www.cnblogs.com/fozero/p/86… Tag: Summary, git