赞
踩
本地当前分支为master,远程仓库为main,且远程仓库与本地仓库有 unrelated histories这样的问题,如远程仓库有README.md但本地没有
git checkout -b main
# Switched to a new branch 'main'
git branch
# * main
# master
git merge master # 将master分支合并到main上
# Already up to date.
git pull origin main --allow-unrelated-histories # git pull origin main会报错:refusing to merge unrelated histories
git push origin main
完成合并
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。