Something happened and our master branch got all screwed up. Rather than spending the time trying to figure out what went wrong, I just want to create a new master branch from an existing tag. So if my tag is v1.0, how do I create a new branch from this tag?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Wow, that was easier than I thought:
git checkout -b newbranch v1.0 回答2:
git branch newbranch v1.0 The above command will just create the new branch, not check it out.
回答3:
I have resolve the problem as below 1. Get the tag from your branch 2. Write below command
Example: git branch git branch hotfix_4.4.3 v4.4.3 git checkout hotfix_4.4.3 or you can do with other command
git checkout -b -b stands for creating new branch to local once you ready with your hotfix branch, It's time to move that branch to github, you can do so by writing below command
git push --set-upstream origin hotfix_4.4.3 回答4:
My branch list (only master now)
My tag list (have three tags)
Switch to new branch feature/codec from opus_codec tag
git checkout -b feature/codec opus_codec 

