假设 repo at$REPO_URL
有多个分支,包括一个名为dev
. 现在,假设我一个接一个地运行以下命令
% git clone $REPO_URL --branch dev wd
% cd wd
% git branch -a
* dev
remotes/origin/HEAD -> origin/master
remotes/origin/dev
remotes/origin/issue6
remotes/origin/issue26
remotes/origin/issue30
...
remotes/origin/issue709
remotes/origin/issue712
remotes/origin/issue716
remotes/origin/master
此时我必须做什么,以便表单的每个分支都有一个与其完全匹配remotes/origin/X
的本地分支?X
我的意思是以下两个命令将产生相同的输出:
% git rev-parse remotes/origin/X
% git rev-parse X
并且输出git branch -a
最终看起来像这样:
* dev
issue6
issue26
issue30
...
issue709
issue712
issue716
master
remotes/origin/HEAD -> origin/master
remotes/origin/dev
remotes/origin/issue6
remotes/origin/issue26
remotes/origin/issue30
...
remotes/origin/issue709
remotes/origin/issue712
remotes/origin/issue716
remotes/origin/master