【发布时间】:2015-04-20 15:05:34
【问题描述】:
我正在尝试将一个新的本地分支product-0.2 推送到已经有同名标签的远程(但分支本身不存在)
git push -v --tags --set-upstream origin product-0.2:product-0.2
Pushing to https://****@github.com/mycompany/product.git
error: src refspec product-0.2 matches more than one.
error: failed to push some refs to 'https://****@github.com/mycompany/product.git'
同理:
git push origin product-0.2:/refs/heads/product-0.2
虽然反过来也可以,例如创建一个分支product-0.1,提交它然后应用标签product-0.1。
有些人通过在本地删除冲突标签,然后推送分支,然后检索远程标签来解决这个问题,但这似乎很麻烦且容易出错。
如何轻松创建我的分支?
感谢您的意见
【问题讨论】:
-
尝试
refs/heads/product-0.2:refs/heads/product-0.2,即不使用前导斜杠,并在本地提供完整的参考规范。 -
可以试试 git push origin product-0.2:product-0.2
标签: git git-branch