git push 到gitlib提示! [rejected] master -> master (non-fast-forward) error: failed to push some refs t

一、git push到gitlab提示,大概意思是本地库和远程库没有同步导致无法提交合并,冲突导致无法push。

! [rejected]            master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:Software/xxxxxxxxxxxxxxxxxx.git'
hint: Updates were rejected because the tip of your current branch is behind

二、解决方案

git branch --set-upstream-to=origin/master
git pull origin master --allow-unrelated-histories 从远端仓库拉取不相关历史

三、操作界面,可以push到gitlab了。

git push 到gitlib提示! [rejected] master -> master (non-fast-forward) error: failed to push some refs t_第1张图片

git push 到gitlib提示! [rejected] master -> master (non-fast-forward) error: failed to push some refs t_第2张图片

三、參考文章

https://www.cnblogs.com/wml-it/p/15585052.html

你可能感兴趣的:(Git,git)