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

问题描述

git push的时候出现了下面的问题

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.

 
 

解决办法

git pull一下,具体流程为以下几步:

$ git pull origin master
$ git push origin master

 
git pull时可能会遇到下面这种情况:

在这里插入图片描述
 

你可以不管它(直接下面3,4步),但如果要输入解释的话就需要:

  1. 按键盘字母 i 进入insert模式

  2. 修改最上面那行黄色合并信息,可以不修改

  3. 按键盘左上角"Esc"

  4. 输入":wq",注意是冒号+wq,按回车键即可

猜你喜欢

转载自blog.csdn.net/weixin_43901865/article/details/112792857