2015-05-10 116 views
0

嗨不同,我想切換到一個特定的分支,part1-es6的Git分支內容從遠程

enter image description here

,但是,當我克隆此回購和結帳這個分支,文件列表不同,我在做什麼錯誤。另外,git branch不列出任何!除了主人。

bsr[~/tmp] $ git clone https://github.com/jlongster/backend-with-webpack.git 
Cloning into 'backend-with-webpack'... 
remote: Counting objects: 106, done. 
remote: Total 106 (delta 0), reused 0 (delta 0), pack-reused 106 
Receiving objects: 100% (106/106), 88.28 KiB | 0 bytes/s, done. 
Resolving deltas: 100% (41/41), done. 
Checking connectivity... done. 
bsr[~/tmp] $ git branch 
fatal: Not a git repository (or any of the parent directories): .git 
bsr[~/tmp] $ cd backend-with-webpack/ 
bsr[~/tmp/backend-with-webpack] [master] $ git branch 
* master 
bsr[~/tmp/backend-with-webpack] [master] $ git checkout -b part1-es6 
Switched to a new branch 'part1-es6' 
bsr[~/tmp/backend-with-webpack] [part1-es6] $ ls 
README.md build  gulpfile.js package.json src   static 
bsr[~/tmp/backend-with-webpack] [part1-es6] $ 
+0

我認爲你正在創建一個新的brach而不是從遠程repo獲取part-es6。 –

回答

1

嘗試git checkout -t origin/part1-es6克隆存儲庫後。

+0

謝謝。有用 !!你知道它爲什麼不用'git branch'列出所有的分支嗎? – bsr

+0

你可以使用'git branch -r'來列出遠程追蹤分支。 @bsr –