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

相关推荐
早安试言34 分钟前
git使用
git
燐妤1 小时前
梦绘片场 ProjectDream故事总纲场景剧本篇:从项目到成片的 AI 漫剧工作台
人工智能·git·ai·项目开发
JackieDYH9 小时前
Git 与 GitHub 新电脑配置指南(从零开始)
git·github·工具·使用教程
Jeanyia20 小时前
GitLab 配套 Git 常用命令
git·gitlab
10mAh1 天前
【Git】误删分支、reset --hard 后提交丢了怎么办?——reflog、fsck 与安全恢复实战
数据库·git·安全·回归
Lydro1 天前
CentOS 7 安装高版本git
git·centos 7
guwentian1 天前
Git Worktree 实战:用并行多 Agent 把开发提速 N 倍
大数据·git·elasticsearch·wroktree
不吃鱼的羊2 天前
Git识别未修改的文件有修改
git
蓝黑墨水2 天前
一个git问题的处理
git
互联网中的一颗神经元2 天前
21 — 额外命令:同时开两个窗口、自动检查哨
git