美文网首页
Git-error: dst refspec branch ma

Git-error: dst refspec branch ma

作者: 金宝妈妈爱金宝 | 来源:发表于2019-07-17 17:45 被阅读0次

    今天想规定代码提交流程,从Master分支上checkout一个新的分支,发现不太好,就想删除结果报错了

     error: dst refspec elaine matches more than one

    error:failed to push some refs to "git@XXXXXXXXX./.XX.git"

    然后用  git push origin --delete branchName 命令删除好几次都是报同样的错误,最后上网一查,还真有同名相连的人

    原因是:远程的仓库中同时存在相同名称的branch和tag,在不知名路径的情况下,就搜索到多个,git就不知道要删除哪个了

    解决方案很简单,指明路径

    对象            路径

    branch        refs/heads/branch_name

    tag             refs/tags/tag_name

    具体命令如下:

    git push origin :refs/heads/branch_name

    git push origin :refs/tags/tag_name

    大家想知道更多的信息可以查看:https://blog.csdn.net/qq_32452623/article/details/76649109

    相关文章

      网友评论

          本文标题:Git-error: dst refspec branch ma

          本文链接:https://www.haomeiwen.com/subject/hdeclctx.html