首页 > 其他 > 详细

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

时间:2019-12-19 15:59:52      阅读:95      评论:0      收藏:0      [点我收藏+]
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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!