git的安装与使用入门

最近看到一个内核注释的代码,想下载下来瞄一下,可,这代码是用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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值