问题解决 - Your configuration specifies to merge with the ref xxx

原因

在执行git pull的时候会报错:
Your configuration specifies to merge with the ref ‘refs/heads/master’ from the remote, but no such ref was fetched
原因是,现在默认分支已更名为 “main”,但本地git仍试图从 "master "中提取,因此出现了此消息。

解决方案:执行以下脚本:

1
2
3
4
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

请我喝杯咖啡吧~

支付宝
微信