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博客

相关推荐
2501_916766543 小时前
【Git学习】Git的tag标签
git·学习
CoderJia程序员甲4 小时前
GitHub 热榜项目 - 日榜(2025-12-11)
git·ai·开源·llm·github
aoxiang_ywj4 小时前
git add 和git commit之后怎么撤销?
git
winner88814 小时前
告别“这个分支是干啥的?”:Git分支层级命名实战
git·git push -u·分支关联·层级分支命名
真上帝的左手5 小时前
3. 代码管理-Git实战
git
lin62534227 小时前
Android仿小米视频播放器的缩放滚轮
android·git·github
互亿无线明明7 小时前
在 Go 项目中集成国际短信能力:从接口调试到生产环境的最佳实践
开发语言·windows·git·后端·golang·pycharm·eclipse
world_in_world7 小时前
git常见场景命令
git
码上成长8 小时前
长耗时接口异步改造总结
前端·git·后端
Elieal8 小时前
Git 面试题全面汇总
git