converting git branch to git tag

前端 未结 2 970
北海茫月
北海茫月 2021-01-12 14:29

I am looking for the best and safest way to convert a git branch to a git tag. When porting over a svn repository by hand, I basically copied over all our branches and we h

2条回答
  •  青春惊慌失措
    2021-01-12 14:54

    As I understand it, you want to create tags instead of branches and thereby prevent others to continue committing on these branches.

    Unfortunately, you cannot prevent people from creating branches from wherever they want, especially since Git is a decentralized VCS. However, you can decide whether a commit can be pushed to a central repository. So you could write hooks that would forbid commits that have specific commits in their ancestors.

提交回复
热议问题