git提交时报错:Updates were rejected because the tip of your current branch is behind
Posted 651434092qq
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git提交时报错:Updates were rejected because the tip of your current branch is behind相关的知识,希望对你有一定的参考价值。
有如下3种解决方法:
1.使用强制push的方法:
git push -u origin master -f
这样会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候。
2.push前先将远程repository修改pull下来
git pull origin master
git push -u origin master
3.若不想merge远程和本地修改,可以先创建新的分支:
git branch [name]
然后push
git push -u origin [name]
以上是关于git提交时报错:Updates were rejected because the tip of your current branch is behind的主要内容,如果未能解决你的问题,请参考以下文章
解决 failed to push some refs to 'git@github.com:zle1992/head-first-java' hint: Updates were r
git学习解决git提交代码时报错: Unable to create ‘XXX/.git/index.lock‘: File exists.
git在提交时报错error invalid path cannot add to the index的解决办法
git学习解决git提交代码时报错: Unable to create ‘XXX/.git/index.lock‘: File exists.
在android的kotlin上用git提交项目时报错提示:Invalid authentication data. 404 Not Found - Not Found
idea提交代码时报错Git Pull Failed: refusing to merge unrelated histories