码迷,mamicode.com
首页 > 其他好文 > 详细

关联吸纳的remote首次push报错rejected

时间:2019-12-19 15:59:32      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:出现   ups   cte   set   fat   some   you   fas   pull   

F:\abb-iot\DmsAPI\DmsAPI (master -> origin)
λ  git push --set-upstream github master
To github.com:G****c/DmsAPI.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to ‘git@github.com:Glorycsc/DmsAPI.git‘
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: ‘git pull ...‘) before pushing again.
hint: See the ‘Note about fast-forwards‘ in ‘git push --help‘ for details.

  

 

入如果pull有这个报错:
fatal: refusing to merge unrelated histories

  此项错误是由于本地仓库和远程有不同的开始点,也就是两个仓库没有共同的 commit 出现的无法提交。这里我们需要用到 --allow-unrelated-histories。也就是我们的 pull 命令改为下面这样的:

git pull origin master --allow-unrelated-histories

如果设置了默认分支,可以这样写:

git pull --allow-unrelated-histories

关联吸纳的remote首次push报错rejected

标签:出现   ups   cte   set   fat   some   you   fas   pull   

原文地址:https://www.cnblogs.com/gloryhope/p/12067853.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!