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

前端 未结 9 2153
被撕碎了的回忆
被撕碎了的回忆 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 07:01

    Github has a feature called Project Pages where you can create a particular named branch in your project to provide files that will be served by Github. Their instructions are as follows:

    $ cd /path/to/fancypants
    $ git symbolic-ref HEAD refs/heads/gh-pages
    $ rm .git/index
    $ git clean -fdx
    

    From there you have an empty repository which you can then add your new content to.

提交回复
热议问题