Git中创建空白branch的方法

因为工作需要,要在一个git repo中创建一个空白的branch,就是和其它branch以及revision没有任何关系的branch,公司的git master(一共就两个)帮我搜了搜找到了答案:

Git Community Book: Creating New Empty Branches


git symbolic-ref HEAD refs/heads/newbranch
rm .git/index # windows: del .gitindex
git clean -fdx
#do work#
git add your files
git commit -m 'Initial commit'

Did you like this? Share it:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.