简体   繁体   中英

gh-pages branch on local

I want to end up with two branches with mutually exclusive content. One for gh-pages, and one for master.

When I use the automatic page generator it automatically creates a new gh-pages branch on remote. I now want to be able to modify that branch locally as a separate branch without combining it with the content from master.

I am using Git 1.7 (no ability to upgrande) so I don't have access to git checkout --orphan

git checkout --orphan gh-pages
error: unknown option `orphan'
usage: git checkout [options] <branch>
   or: git checkout [options] [<branch>] -- <file>...

    -q, --quiet           be quiet
    -b <new branch>       branch
    -l                    log for new branch
    -t, --track           track
    -2, --ours            stage
    -3, --theirs          stage
    -f, --force           force
    -m, --merge           merge
    --conflict <style>    conflict style (merge or diff3)
    -p, --patch           select hunks interactively

No need for --orphan . git checkout -b gh-pages will do it. When you want to push it up, just specify the branch with git push origin gh-pages .

When you use checkout with -b , it will automatically track the remote branch if available.

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