2016-12-04 12 views
1

私はフォークを持っていて、私は自分のコンピュータにリポジトリをクローンするためにクローンコマンドを使用しました。今は1つのブランチを表示していますが、フォークは4つのブランチを持っています。私は、その後のステップのクローン作成時にフォークのすべてのブランチをクローンする方法は?

シリーズ:

$ git branch 
* master 

[email protected] MINGW32 ~/Desktop/KIRAN/VITacademics-Enhancement-Suite (master) 
$ git remote add upstream https://github.com/rahulkapoor90/VITacademics-Enhancement-Suite 

[email protected] MINGW32 ~/Desktop/KIRAN/VITacademics-Enhancement-Suite (master) 
$ git remote remove jwasham 

[email protected] MINGW32 ~/Desktop/KIRAN/VITacademics-Enhancement-Suite (master) 
$ git fetch upstream 
From https://github.com/rahulkapoor90/VITacademics-Enhancement-Suite 
* [new branch]  Development -> upstream/Development 
* [new branch]  master  -> upstream/master 
* [new branch]  material-ui -> upstream/material-ui 

は、今私はそれを異なる色で示した-aコマンドgitのブランチに入りました。

$ git branch -a 
* master 
    remotes/origin/Development 
    remotes/origin/HEAD -> origin/master 
    remotes/origin/master 
    remotes/origin/material-ui 
    remotes/upstream/Development 
    remotes/upstream/master 
    remotes/upstream/material-ui 

しかし、私はそれがHEADから離脱されている任意のブランチをチェックアウトする場合、私はgit branch .Butを入力すると、これらの枝は、デフォルトの枝に表示されていません。

この問題の解決方法を教えてください。

+2

可能な重複[Gitリポジトリ内のすべてのリモートブランチのクローンを作成するには?](http://stackoverflow.com/questions/67699/how -to-clone-all-remote-branches-in-git) – C1sc0

答えて

1

masterというローカルブランチは1つだけです。他のブランチはremotes/origin/*またはremotes/upstream/*で始まります。

リモートブランチの変更/コミットを持つローカルブランチを作成する場合は、ブランチ名でcheckoutするだけです。それとも、あなたの新しいブランチにリモートブランチを引っ張っ&新しいブランチを作成

$ git checkout -b Development origin/Development 

Or, 
    $ git checkout master   
    $ git checkout -b Development 
    $ git pull origin Development   
関連する問題