在RHEL-5.5上安装Git-1.7.2

[list]
[*][b]先检查下版本信息:[/b]

[@sohu_99_3 ~]# lsb_release -a
LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Release: 5.5
Codename: Tikanga


[@sohu_99_3 ~]# uname -a
Linux sohu_99_3 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux


[@sohu_99_3 ~]# cat /proc/version
Linux version 2.6.18-194.el5 (mockbuild@x86-005.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:39 EDT 2010


[*][b]因为编译安装,所以先安装相应的devel包:[/b]
yum install zlib-devel
yum install gettext-devel
yum install openssl-devel
yum install curl-devel
yum install expat-devel


[*]下载解压缩git:
wget http://kernel.org/pub/software/scm/git/git-1.7.2.tar.gz

tar -xzvf git-1.7.2.tar.gz

[*]编译安装:
cd git-1.7.2

make prefix=/usr/local all

make prefix=/usr/local install

[*][b]检查一下:[/b]
[b]安装好的文件:[/b]
[@sohu_99_3 ~]# ll /usr/local/bin/
total 17948
-rwxr-xr-x 105 root root 4623648 Aug 12 09:40 git
-rwxr-xr-x 1 root root 120943 Aug 12 09:40 git-cvsserver
-rwxr-xr-x 1 root root 321995 Aug 12 09:40 gitk
-rwxr-xr-x 1 root root 4623648 Aug 12 09:40 git-receive-pack
-rwxr-xr-x 1 root root 1926258 Aug 12 09:40 git-shell
-rwxr-xr-x 1 root root 4623648 Aug 12 09:40 git-upload-archive
-rwxr-xr-x 1 root root 1970204 Aug 12 09:40 git-upload-pack
-rwxr-xr-x 1 root root 1576 Aug 10 10:58 pcre-config
-rwxr-xr-x 1 root root 35248 Aug 10 10:58 pcregrep
-rwxr-xr-x 1 root root 54467 Aug 10 10:58 pcretest

[b]git命令的执行:[/b]
[@sohu_99_3 ~]# git
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
[-c name=value
[--help] COMMAND [ARGS]

The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG

See 'git help COMMAND' for more information on a specific command.

[b]从github上获取项目:[/b]
[@sohu_99_3 mochi]# git clone http://github.com/mochi/mochiweb.git
Cloning into mochiweb...
remote: Counting objects: 921, done.
remote: Compressing objects: 100% (326/326), done.
remote: Total 921 (delta 638), reused 813 (delta 575)
Receiving objects: 100% (921/921), 182.37 KiB | 24 KiB/s, done.
Resolving deltas: 100% (638/638), done.
[/list]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值