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

相关推荐
C++ 老炮儿的技术栈7 小时前
在 Scintilla 中为 Squirrel 语言设置语法解析器的方法
linux·运维·c++·git·ubuntu·github·visual studio
余很多之很多11 小时前
命令行和neovim的git操作软件-lazygit
git
猫头虎11 小时前
GitHub下载教程:2025年最新详解从GitHub上传、下载文件、子目录与完整项目【图文教程】
git·svn·gitee·开源·github·gitea·gitcode
i建模18 小时前
将远程 main 分支同步到 develop 分支的完整指南
git
即使再小的船也能远航1 天前
【Git】实用Git操作指南:从入门到高效协作
git
<但凡.2 天前
Git 完全手册:从入门到团队协作实战(4)
git·bash
SugarPPig2 天前
Git 创建一个完全没有提交历史的 master 分支
git
lb29172 天前
git的使用,推送仓库github
git·github
躲在云朵里`3 天前
Git的使用
大数据·git·elasticsearch
悟能不能悟3 天前
在 IntelliJ IDEA 中打开这个用于设置 Git 用户名(Name)和邮箱(Email)的特定弹窗
java·git·intellij-idea