主要是要先 Fetch 一下
只能看到master(init之后)
不知道下面做法会不会有副作用(资源大,分支多,很慢)
zhuya主要是使用命令:git fetch
=====================================================
检查.git/config
是否包含
[remote "origin"]
url = …
fetch = +refs/heads/master:refs/remotes/origin/master
如果是这样,改为说
[remote "origin"]
url = …
fetch = +refs/heads/*:refs/remotes/origin/*
然后你应该能够使用它:
$ git fetch
remote: Counting objects: …
remote: Compressing objects: ..
Unpacking objects: …
remote: …
From …
* [new branch] branchname -> origin/branchname
$ git checkout branchname
Branch branchname set up to track remote branch branchname from origin.
Switched to a new branch 'branchname'