关于git的submodule

这是一篇好文章, 不转过来似乎都觉得对不起自己

转自:http://blog.cnrainbird.com/index.php/2012/05/31/guan_yu_git_de_submodule/


搞开发的都大都知道章鱼猫吧(github,哈哈~~)。里面有各种智慧的结晶合理利用,事半功倍。
可是最近发现里面稍微复杂一些的工程都开始整submodule了。无论是直接zip下载,还是clone的,submodule都是空的,这样的运行肯定会提示缺少文件撒。以icyleaf的ShareKit为例,里面依懒了JSONKit等其它开源工程。这种情况下怎么办呢?还是直接命令行吧。打开终端(terminal)找个地儿执行以下命令:

[rainbird@localhost tmp]$ git clone https://github.com/icyleaf/ShareKit
Cloning into 'ShareKit'...
remote: Counting objects: 7016, done.
remote: Compressing objects: 100% (2919/2919), done.
remote: Total 7016 (delta 4330), reused 6439 (delta 3845)
Receiving objects: 100% (7016/7016), 1.83 MiB | 266 KiB/s, done.
Resolving deltas: 100% (4330/4330), done.
[rainbird@localhost tmp]$ cd ShareKit/
[rainbird@localhost ShareKit]$ git submodule init
Submodule 'Submodules/JSONKit' (https://github.com/johnezang/JSONKit.git) registered for path 'Submodules/JSONKit'
Submodule 'Submodules/facebook-ios-sdk' (https://github.com/ShareKit/facebook-ios-sdk.git) registered for path 'Submodules/facebook-ios-sdk'
Submodule 'Submodules/objectiveflickr' (https://github.com/lukhnos/objectiveflickr.git) registered for path 'Submodules/objectiveflickr'
Submodule 'Submodules/sskeychain' (https://github.com/samsoffes/sskeychain.git) registered for path 'Submodules/sskeychain'
[rainbird@localhost ShareKit]$ git submodule update
Cloning into 'Submodules/JSONKit'...
remote: Counting objects: 257, done.
remote: Compressing objects: 100% (143/143), done.
remote: Total 257 (delta 121), reused 241 (delta 112)
Receiving objects: 100% (257/257), 155.91 KiB | 45 KiB/s, done.
Resolving deltas: 100% (121/121), done.
Submodule path 'Submodules/JSONKit': checked out '02b983fa8f26521e47dc1d49e3a47ed062e20058'
Cloning into 'Submodules/facebook-ios-sdk'...
remote: Counting objects: 1072, done.
remote: Compressing objects: 100% (562/562), done.
remote: Total 1072 (delta 592), reused 889 (delta 458)
Receiving objects: 100% (1072/1072), 1.87 MiB | 289 KiB/s, done.
Resolving deltas: 100% (592/592), done.
Submodule path 'Submodules/facebook-ios-sdk': checked out '0fc17686f4ab288731e6c46dcbb3bcca14d67a49'
Cloning into 'Submodules/objectiveflickr'...
remote: Counting objects: 746, done.
remote: Compressing objects: 100% (251/251), done.
remote: Total 746 (delta 472), reused 724 (delta 457)
Receiving objects: 100% (746/746), 230.60 KiB | 53 KiB/s, done.
Resolving deltas: 100% (472/472), done.
Submodule path 'Submodules/objectiveflickr': checked out 'e6df2db06c1401b7a1777ac37a26a87affc019a6'
Cloning into 'Submodules/sskeychain'...
remote: Counting objects: 159, done.
remote: Compressing objects: 100% (105/105), done.
remote: Total 159 (delta 93), reused 110 (delta 49)
Receiving objects: 100% (159/159), 30.86 KiB | 31 KiB/s, done.
Resolving deltas: 100% (93/93), done.
Submodule path 'Submodules/sskeychain': checked out 'f4e024617e73c06028569d0d29f43a70d260ec0f'
[rainbird@localhost ShareKit]$

that’s all ! 如果没问题的话,这个工程应该可以正常运行了。你可以直接

[rainbird@localhost ShareKit]$ open .

然后双击工程运行测试了。~~
顺便打下广告:这个ShareKit增加了对新浪微博,网易微博,腾讯微博,豆瓣,人人网等第三方的分享支持,敬开源!



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值