How do you push a tag to a remote repository using Git?

前端 未结 9 1013
滥情空心
滥情空心 2020-11-22 16:31

I have cloned a remote Git repository to my laptop, then I wanted to add a tag so I ran

git tag mytag master

When I run git tag

9条回答
  •  悲&欢浪女
    2020-11-22 17:15

    How can I push my tag to the remote repository so that all client computers can see it?

    Run this to push mytag to your git origin (eg: GitHub or GitLab)

    git push origin refs/tags/mytag
    

    It's better to use the full "refspec" as shown above (literally refs/tags/mytag) just in-case mytag is actually v1.0.0 and is ambiguous (eg: because there's a branch also named v1.0.0).

提交回复
热议问题