maven-release-plugin 是否将标签推送到远程 Git 存储库?
当将 maven-release-plugin 与 Git 一起使用时,mvn release:prepare 会愉快地在本地存储库中标记发布。我希望 mvn release:perform 将标签推送到远程存储库,但这似乎不会发生。
我错了吗?
如果没有,是否有一个选项可以将发布标签推送到远程存储库?
When using the maven-release-plugin with Git, mvn release:prepare happily tags the release in the local repository. I'd expect mvn release:perform to push the tags to the remote repository, but this doesn't seem to happen.
Am I mistaken?
If not, is there an option to enable pushing release tags to the remote repository?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我来说,release-prepare 似乎推送了三次:
鉴于它为标签推送显式指定了
origin
,只有当您的 git-remote 别名实际上称为origin
时,它才可能成功推送标签。要查看您的名称,请运行 git remote -v 。
另请注意,不带参数的 git push 可能会默认为除 origin 之外的其他内容,具体取决于您的存储库配置 - 即它可能一直在尝试将提交推送到一个位置并将标签推送到其他。请参阅此处了解这些默认值的来源:
http://www.kernel.org/pub /software/scm/git/docs/git-push.html#REMOTES
For me,
release-prepare
seems to be pushing three times:git push
with no arguments, to push that commit.git push origin <tagname>
, which is what should push the tag.git push
with no arguments again.Given that it's explicitly specifying
origin
for the tag push, it may only successfully push the tags if your git-remote alias is actually calledorigin
.To see what yours are called, run
git remote -v
.Note also that
git push
without arguments may default to something other thanorigin
, depending on your repository config - i.e. it may have been trying to push commits to one place and tags to another. See here for where those defaults come from:http://www.kernel.org/pub/software/scm/git/docs/git-push.html#REMOTES