Is there a simple command to convert a branch to a tag?

后端 未结 3 1137

I am about to complete a tedious process of converting \"dumb snapshots\" to git. This process has been going very well (thanks to this rename process), but now I realized that

3条回答
  •  孤独总比滥情好
    2021-02-02 09:28

    The answers given are basically correct.

    As tags and branches are just names for objects, there is a simpler way without touching current work area:

    git tag  refs/heads/ # or just git tag  
    git branch -d 
    

    Or even do it to remote server without touching local repository at all:

    git push origin origin/:refs/tags/
    git push origin :refs/heads/
    

提交回复
热议问题