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

相关推荐
风禾万里6 小时前
Git怎么管理软件版本(代码,模型,配置等)
git
默默coding的程序猿8 小时前
3.git的分支携带问题是什么?怎么解决?
java·git·python·svn·gitee·github·intellij-idea
天地人-神君12 小时前
将.idea取消git托管
java·git·intellij-idea
Zach_yuan15 小时前
版本控制器Git
linux·git
唐青枫21 小时前
Git 提交时神秘的 create mode 100644 到底是什么?一文告诉你答案!
git
春生野草21 小时前
Git-git stash与分支管理
git
ljh57464911921 小时前
Git合并冲突解决方法
git
悟能不能悟21 小时前
git revert commit和undo commit的区别
git
222you1 天前
Git的diff命令
git
补三补四1 天前
Git 基础操作指南
大数据·git·elasticsearch