How to create a branch without adding all the existing files?

后端 未结 3 1639
天命终不由人
天命终不由人 2021-01-31 15:58

When I create branch in git, all the created files are added to the new branch.

How can I create a branch without adding all the existing files?

3条回答
  •  后悔当初
    2021-01-31 16:45

    The current answers are correct, you'd need an orphaned branch, but I would just add that coincidentally...

    This is actually exactly how github.com lets users create Github Pages for their repos, thru an orphaned branch called gh-pages. The pretty steps are given and explained here:

    https://help.github.com/articles/creating-project-pages-manually

    Hope this helps!

提交回复
热议问题