git命令之git fetch 用法 2


git fetch 从另一个repository中下载objects and refs

git fetch 从另一个repository中下载objects and refs, 这里用git fetch获取Android Kernel:

Android Kernel的git repository在 git://android.git.kernel.org/kernel/common.git

首先,先建立一个工作目录:
$ mkdir android-kernel-git
$ cd android-kernel-git

建立git环境:
$ git init
$ git remote add android git://android.git.kernel.org/kernel/common.git

获取android kernel
$ git fetch android

remote: Counting objects: 1637009, done.
remote: Compressing objects: 100% (272756/272756), done.
remote: Total 1637009 (delta 1360356), reused 1622966 (delta 1350661)
Receiving objects: 100% (1637009/1637009), 336.06 MiB | 203 KiB/s, done.
Resolving deltas: 100% (1360356/1360356), done.
From git://android.git.kernel.org/kernel/common
* [new branch]      android-2.6.25 -> android/android-2.6.25
* [new branch]      android-2.6.27 -> android/android-2.6.27
* [new branch]      android-2.6.29 -> android/android-2.6.29
* [new branch]      android-2.6.32 -> android/android-2.6.32
* [new branch]      android-2.6.35 -> android/android-2.6.35
* [new branch]      android-goldfish-2.6.27 -> android/android-goldfish-2.6.27
* [new branch]      android-goldfish-2.6.29 -> android/android-goldfish-2.6.29
From git://android.git.kernel.org/kernel/common
* ………
* [new tag]         v2.6.32    -> v2.6.32
* [new tag]         v2.6.32-rc1 -> v2.6.32-rc1
* [new tag]         v2.6.32-rc2 -> v2.6.32-rc2
* [new tag]         v2.6.32-rc3 -> v2.6.32-rc3
* [new tag]         v2.6.32-rc4 -> v2.6.32-rc4
* [new tag]         v2.6.32-rc5 -> v2.6.32-rc5
* [new tag]         v2.6.32-rc6 -> v2.6.32-rc6
* [new tag]         v2.6.32-rc7 -> v2.6.32-rc7
* [new tag]         v2.6.32-rc8 -> v2.6.32-rc8

查看当前有那些分支:
$ git branch -a
remotes/android/android-2.6.25
remotes/android/android-2.6.27
remotes/android/android-2.6.29
remotes/android/android-2.6.32
remotes/android/android-2.6.35
remotes/android/android-goldfish-2.6.27
remotes/android/android-goldfish-2.6.29

把2.6.35的分支checkout出来:
$ git checkout -b working remotes/android/android-2.6.35
$ git branch -a
* working

remotes/android/android-2.6.25
remotes/android/android-2.6.27
remotes/android/android-2.6.29
remotes/android/android-2.6.32
remotes/android/android-2.6.35
remotes/android/android-goldfish-2.6.27
remotes/android/android-goldfish-2.6.29

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值