使用 git remote add origin git@gitlab.test.com/fe-test.git 关联远程仓库,然后使用执行 git push -u origin master 报错:fatal: refusing to merge unrelated histories,Updates were rejected because the tip of your current branch is behind its remote counterpart。
一、完整报错
git pull origin master,报错:fatal: refusing to merge unrelated historiesgit push -u origin master,报错:Updates were rejected because the tip of your current branch is behind its remote counterpart
二、解决办法
在 git pull 的时候加上 –allow-unrelated-histories 参数,作用就是把两个不相干的分支进行强行合并。
1 | |
欢迎访问:天问博客
本文作者: Tiven
发布时间: 2023-08-25
最后更新: 2023-08-28
本文标题: Git提示fatal: refusing to merge unrelated histories
本文链接: https://www.tiven.cn/p/b3fa3e34/
版权声明: 本作品采用 CC BY-NC-SA 4.0 许可协议进行许可。转载请注明出处!
发布时间: 2023-08-25
最后更新: 2023-08-28
本文标题: Git提示fatal: refusing to merge unrelated histories
本文链接: https://www.tiven.cn/p/b3fa3e34/
版权声明: 本作品采用 CC BY-NC-SA 4.0 许可协议进行许可。转载请注明出处!


