git出现错误hint: Updates were rejected because the remote contains work that you do

Problem Description

git pushThe following problem occurred when

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., ‘git pull …’) before pushing again.
hint: See the ‘Note about fast-forwards’ in ‘git push --help’ for details.

 
 

Solution

First git pull, the specific process is the following steps:

$ git pull origin master
$ git push origin master

 
At the git pulltime, you may encounter the following situations:

Insert picture description here
 

You can ignore it ( steps 3 and 4 directly below ), but if you want to enter an explanation, you need:

  1. Press the keyboard letter i to enter the insert mode

  2. Modify the top row of yellow merge information, you don't need to modify it

  3. Press "Esc" in the upper left corner of the keyboard

  4. Type ":wq", pay attention to the colon+wq, and press Enter

Guess you like

Origin blog.csdn.net/weixin_43901865/article/details/112792857
Recommended