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

相关推荐
ice___Cpu7 小时前
Git - 1( 14000 字详解 )
大数据·git·elasticsearch
范纹杉想快点毕业1 天前
以项目的方式学QT开发(一)——超详细讲解(120000多字详细讲解,涵盖qt大量知识)逐步更新!
c语言·数据结构·c++·git·qt·链表·github
qq_653644461 天前
如何查看打开的 git bash 窗口是否是管理员权限打开
开发语言·windows·git·bash
tonngw1 天前
【Mac 从 0 到 1 保姆级配置教程 12】- 安装配置万能的编辑器 VSCode 以及常用插件
git·vscode·后端·macos·开源·编辑器·github
橄榄熊1 天前
Git 常用命令详解
git
o(╥﹏╥)2 天前
绑定 SSH key(macos)
开发语言·git·学习·macos
半新半旧2 天前
Git 分支指南
git
qq_464357012 天前
git中忽略文件.gitignore文件的用法
git
程序员阿鹏2 天前
Git的安装和配置(idea中配置Git)
java·开发语言·ide·git·intellij-idea·idea
belldeep3 天前
如何阅读、学习 Git 核心源代码 ?
git·学习·源代码