dongnan
总版主
总版主
  • 粉丝52
  • 发帖数2165
  • 铜币13236枚
  • 威望5838点
  • 银元150个
  • 社区居民
  • 最爱沙发
  • 忠实会员
  • 原创写手
阅读:608回复:0

git clone 指定的分支

楼主#
更多 发布于:2017-10-31 10:51
示例: 克隆 online 分支
git clone -b online git@git.zongming.net:git/irm-py.git test
正克隆到 'test'...
remote: Counting objects: 83, done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 83 (delta 35), reused 0 (delta 0)
接收对象中: 100% (83/83), 41.17 KiB | 0 bytes/s, done.
处理 delta 中: 100% (35/35), done.
检查连接... 完成。

1. 当前分支
git branch
* online

2. 全部分支
git branch -a
* online
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
  remotes/origin/online

3. 验证
ls
acct.py  background.py version.xml

参数
man git-clone
       --branch <name>, -b <name>
           Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be checked out.  --branch can also take tags and detaches the HEAD at that commit in the resulting repository.
#
游客

返回顶部