使用 Git 报错 error: src refspec master matches more than one.

时间:2023-03-09 05:02:37
使用 Git 报错 error: src refspec master matches more than one.

今天在使用 Git push 代码时遇到一个报错:

error: src refspec master matches more than one.
error: failed to push some refs to 'git@127.0.0.1:yn/enh.git'

出现这个错误是因为有一个与当前提交分支同名的标签

查看标签列表:

git tag

删除这个标签(确定标签无用时):

git tag -d <tag-name>

再次 push 就 ok 了