简体   繁体   中英

How can I create a new git branch from the base of the commit tree , which has no commit in common with master branch ? for gh-pages

I want to make a new branch from the base of the master branch, such that the new branch has no commit the same as the master branch.

the new branch will be totally different from the master branch, and never to be merged to master

I want to do this because I want to create a gh-pages branch, to host my site. When I click on choose theme in GitHub settings, it creates such a dream branch. But how to create such a branch from the command line??

If you want to create a completely empty branch you can use the orphan option of the git command:

git checkout --orphan gh-pages

Then you can add your commits and push the new branch to the repository. There are still several ways that can be used. They are described here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM