赞
踩
git branch -a
例子:
$git branch -a
* master
remotes/origin/TMP
remotes/origin/HEAD -> origin/master
remotes/origin/AA
remotes/origin/BB
git checkout -b tmp origin/TMP
上方命令的含义:在本地创建tmp分支,并从远程branch origin/TMP拉取
例子:
$git checkout -b TMP origin/TMP
Updating files: 100% (19896/19896), done.
Branch 'TMP' set up to track remote branch 'TMP' from 'origin'.
Switched to a new branch 'TMP'
注意:若需要切换到他人新创建的branch上,需将当前目录git pull, 否则无法切换分支。git branch -a时看不到新的远程分支。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。