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

相关推荐
jstart千语3 小时前
【Git】连接github时的疑难杂症(DNS解析失败)
git·github
工具罗某人3 小时前
TortoiseGit使用图解
git
Zhuai-行淮4 小时前
vscode和git 踩坑
ide·git·vscode
这颗橘子不太甜QAQ5 小时前
Husky使用技巧
javascript·git·代码规范
fanTuanye5 小时前
Git基本使用(很详细)
git·github
忍者扔飞镖5 小时前
git
git
李菠菜7 小时前
解决Windows系统下Git克隆时报错“unable to checkout working tree”的方法详解
windows·git
island13147 小时前
【git#4】分支管理 -- 知识补充
大数据·git·elasticsearch
船长@Quant8 小时前
协作开发攻略:Git全面使用指南 — 引言
git·版本控制·源代码管理·协作开发
极小狐9 小时前
极狐GitLab 项目功能和权限解读
运维·git·安全·gitlab·极狐gitlab