场景:
其他开发者(A)push了新的分支;
正常开发中,在同一项目中我本地也看到对应的仓库内有该分支;
某天A 又删除了该分支;
我的本地分支push不上去,命令行查看origin 快照确实存在该分支【但是gitlab查看确实没有该远程分支】
导致我的push一直报错:
Your configuration specifies to merge with the ref 'refs/heads/branchV1.0.0'
from the remote, but no such ref was fetched.
原因是找不到该远程分支;
这时需要更新远程分支列表,发现本地的origin 中没有该分支了;这时可以把本地分支push上去;
解决:
git更新远程分支列表:
git remote update origin --prune