git常见错误

refusing to merge unrelated histories

如果git merge合并的时候出现refusing to merge unrelated histories的错误,原因是两个仓库不同而导致的,需要在后面加上--allow-unrelated-histories进行允许合并,即可解决问题。

复制代码
git push origin <branch_name>

Updates were rejected because the tip of your current branch is behind

使用git branch --set-upstream-to=origin/master master将本地关联到远程,在git push。

使用参考地址Git 常用基本命令使用详细大全_git命令行-CSDN博客

相关推荐
半夏微凉半夏殇3 小时前
git add . 是否会包含.o、.so、.ko文件?深度解析与避坑指南
git
牟同學3 小时前
Git 实战场景操作大全(可直接落地)
git
不做无法实现的梦~4 小时前
使用ros2跑mid360的fastlio2建图
git·单片机·嵌入式硬件·gitcode
长沙红胖子Qt6 小时前
SVN培训笔记(二):使用sourceTree通过git桥接管理svn项目
git·svn·sourcetree·sourcetree管理svn
半夏微凉半夏殇7 小时前
从多仓库到单仓库:如何高效迁移并统一管理多个Git项目
git
__万波__8 小时前
解决警告“..LF will be replaced by CRLF the next time Git touches it“
git
Software攻城狮8 小时前
git报错处理
git
明洞日记9 小时前
【软考每日一练015】计算机网络:DNS 递归查询与迭代查询解析
git·计算机网络·github
安河桥畔9 小时前
Git使用
大数据·git·elasticsearch
会跑步的蜗牛9 小时前
git相关问题(个人记录)
git