2012-02-28 12 views
2

1.7のシステムで試してみるとうまくいくので、git 1.5での私の経験不足から問題が発生しているようです。なぜ、私は「枝なし」に終わるのですか?そして、もっと重要なことに、「interesting_branch」のHEADに行くためには何ができますか?あなたが手動でローカルのトラッキングブランチを作成する必要がgit checkout "origin/branch-name"がgit 1.5の "no branch"になるのはなぜですか?

$ git --version 
git version 1.5.6.5 
git clone [email protected]:path/to/repo 
Initialized empty Git repository in some/local/path/.git 
<snip> 
cd path 
git branch -a 
* master 
    origin/HEAD 
    origin/develop 
    origin/feature-cg-interesting_branch 
$ git checkout feature-cg-interesting_branch 
error: pathspec 'feature-cg-interesting_branch' did not match any file(s) known to git. 
$ git checkout -- feature-cg-interesting_branch 
error: pathspec 'feature-cg-interesting_branch' did not match any file(s) known to git. 
$ git checkout origin/feature-cg-interesting_branch 
Note: moving to "origin/feature-cg-interesting_branch" which isn't a local branch 
If you want to create a new branch from this checkout, you may do so 
(now or later) by using -b with the checkout command again. Example: 
    git checkout -b <new_branch_name> 
HEAD is now at 6534d1d... [Commit message] 
$ git branch 
    * (no branch) 
    master 

答えて

5

$ git checkout -b feature-cg-interesting_branch origin/feature-cg-interesting_branch 

あなたはmaster

1

origin/master以外の各remoreブランチのためにそれを行う必要があり、ローカル分岐ではありませんので、それがあなたのリポジトリを残しデタッチされたヘッド状態(タグやハッシュでコミットをチェックアウトした場合など)。リモートブランチは、最後にリモートリポジトリと同期した各ブランチの最後の状態を追跡するためのものです。

さらに、そのブランチをさらに展開する場合は、ローカルブランチを作成する必要があります。

関連する問題