In git, is there a simple way of introducing an unrelated branch to a repository?

前端 未结 9 2156
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 06:11

While helping a friend with a git problem today, I had to introduce a branch that needed to be totally separate from the master branch. The contents of this bra

9条回答
  •  时光取名叫无心
    2020-11-22 06:51

    From Git Community Book:

    git symbolic-ref HEAD refs/heads/newbranch 
    rm .git/index 
    git clean -fdx 
     
    git add your files 
    git commit -m 'Initial commit'
    

提交回复
热议问题