Do git tags get pushed as well?

前端 未结 5 1701
青春惊慌失措
青春惊慌失措 2020-11-29 16:27

Since I created my repository it appears that the tags I have been creating are not pushed to the repository. When I do git tag on the local directory all the t

5条回答
  •  旧时难觅i
    2020-11-29 16:36

    Note that since git 1.8.3 (April 22d, 2013), you no longer have to do 2 commands to push branches, and then to push tags:

    The new "--follow-tags" option tells "git push" to push relevant annotated tags when pushing branches out.

    You can now try, when pushing new commits:

    git push --follow-tags
    

    That won't push all the local tags though, only the annotated ones referenced by commits which are pushed with the git push.


    This has been introduced in commit c2aba15 by Junio C Hamano (gitster):

    The new option "--follow-tags" tells "git push" to push annotated tags that are missing from the other side and that can be reached by the history that is otherwise pushed out.

    For example, if you are using the "simple", "current", or "upstream" push, you would ordinarily push the history leading to the commit at your current HEAD and nothing else.
    With this option, you would also push all annotated tags that can be reached from that commit to the other side.


    The config push.followTags allows to include --follow-tags by default (Git 2.4.1+, Q2 2015).   See "Push git commits & tags simultaneously"

提交回复
热议问题