问题描述
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步),但如果要输入解释的话就需要:
-
按键盘字母 i 进入insert模式
-
修改最上面那行黄色合并信息,可以不修改
-
按键盘左上角"Esc"
-
输入":wq",注意是冒号+wq,按回车键即可