V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
bravluna
V2EX  ›  git

git 的 root branch 是什么,如何从 master 快速切换到另一个 root branch?

  •  
  •   bravluna · 2012-05-05 03:43:21 +08:00 · 3845 次点击
    这是一个创建于 4367 天前的主题,其中的信息可能已经有所发展或是发生改变。
    4 条回复    1970-01-01 08:00:00 +08:00
    linjunpop
        1
    linjunpop  
       2012-05-05 08:33:17 +08:00
    $ cd /path/to/fancypants
    $ git symbolic-ref HEAD refs/heads/gh-pages
    $ rm .git/index
    $ git clean -fdx

    这样会创建一个 root branch,只是一个 branch 而已,其他操作和 branch 一样。
    tuoxie007
        2
    tuoxie007  
       2012-05-05 08:36:01 +08:00
    checkout不行么?
    bravluna
        3
    bravluna  
    OP
       2012-05-05 11:22:13 +08:00
    @linjunpop 这样新建了 gp-pages 的 root branch,用 git branch 命令并不能列出,而且以后如何快速切换到 gp-pages?难道每次都输入4行?
    bravluna
        4
    bravluna  
    OP
       2012-05-05 17:40:56 +08:00
    在新建的 gp-pages 上提交一次,分支才建立起来。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5201 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 08:22 · PVG 16:22 · LAX 01:22 · JFK 04:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.