最近看到一个内核注释的代码,想下载下来瞄一下,可,这代码是用git存储管理的,没办法,只能在自己的虚拟机上弄了。试用了下git,达到了我的目的。

使用yum安装git

[root@localhost install-pngynghay]# yum install git-core

更新git

[root@localhost install-pngynghay]# git clone git://git.kernel.org/pub/scm/git/git.git
Initialized empty Git repository in /home/install-pngynghay/git/.git/
remote: Counting objects: 170329, done.
remote: Compressing objects: 100% (42774/42774), done.
remote: Total 170329 (delta 125743), reused 170108 (delta 125546)
Receiving objects: 100% (170329/170329), 42.59 MiB | 591 KiB/s, done.
Resolving deltas: 100% (125743/125743), done.

创建用户名和联系方式

[root@localhost install-pngynghay]# git config --global user.name "lion"
[root@localhost install-pngynghay]# git config --global user.email5---------7@qq.com

 

创建版本库

[root@localhost install-pngynghay]# mkdir liongit
[root@localhost install-pngynghay]# cd liongit/
[root@localhost liongit]# ls
[root@localhost liongit]#
[root@localhost liongit]# git init
Initialized empty Git repository in /home/install-pngynghay/liongit/.git/

 

下载代码至本地

[root@localhost liongit]# git pull git://code.csdn.net/chenyu105/linux_kernel_2-6-11-12_comment.git
remote: Counting objects: 19210, done.
remote: Compressing objects: 100% (15899/15899), done.
remote: Total 19210 (delta 2020), reused 19206 (delta 2019)
Receiving objects: 100% (19210/19210), 50.01 MiB | 251 KiB/s, done.
Resolving deltas: 100% (2020/2020), done.
From git://code.csdn.net/chenyu105/linux_kernel_2-6-11-12_comment
 * branch            HEAD       -> FETCH_HEAD
[root@localhost liongit]# ls
arch     Documentation  init    MAINTAINERS  README          security
COPYING  drivers        ipc     Makefile     README.md       sound
CREDITS  fs             kernel  mm           REPORTING-BUGS  usr
crypto   include        lib     net          scripts

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐