Git:Install GIT on RHEL5U10 By EPEL
(本文档的实施需要目标服务器联网)
Git是用于Linux内核开发的版本控制工具。和它类似的软件有:CVS、Subversion等。Git不同于以往的版本控制软件的地方在于,它不需要服务器端软件,而是通过分布式版本库实现的。这样做使得源代码的发布于交流更为方便。
Git具有合并追踪(Merge Tracing)的能力。
目前,使用Git来做开发过程中的代码管理的项目包括:WINE、U-Boot等。
(本文档主要针对RHEL5 Update10的Linux发行版上如何部署GIT的技术细节)
实施本文的前提:一台安装完好的RHEL
操作系统版本:Red Hat Enterprise Linux 5 Update 10
**本文档兼容(可正确无误的部署)的操作系统版本为:RHEL4、5、6;CentOS4、5、6,其他的平台没有测试过。
——————————————————
一、配置EPEL环境
EPEL介绍:https://fedoraproject.org/wiki/EPEL/zh-cn
for RHEL5
Command:
rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
[root@Testing-Server software]# pwd /software [root@Testing-Server software]# ll total 0 [root@Testing-Server software]# wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm --2014-07-13 00:23:31-- http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm Resolving dl.fedoraproject.org... 209.132.181.24, 209.132.181.25, 209.132.181.26, ... Connecting to dl.fedoraproject.org|209.132.181.24|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 12232 (12K) [application/x-rpm] Saving to: `epel-release-5-4.noarch.rpm' 100%[======================================>] 12,232 17.5K/s in 0.7s 2014-07-13 00:23:32 (17.5 KB/s) - `epel-release-5-4.noarch.rpm' saved [12232/12232] [root@Testing-Server software]# ll total 16 -rw-r--r-- 1 root root 12232 Aug 12 2010 epel-release-5-4.noarch.rpm [root@Testing-Server software]# du -sh * 16K epel-release-5-4.noarch.rpm [root@Testing-Server software]# [root@Testing-Server software]# rpm -qa | grep epel [root@Testing-Server software]# rpm -ivh epel-release-5-4.noarch.rpm warning: epel-release-5-4.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6 Preparing... ########################################### [100%] 1:epel-release ########################################### [100%] [root@Testing-Server software]# [root@Testing-Server software]# rpm -qa | grep epel epel-release-5-4 [root@Testing-Server software]# [root@Testing-Server software]# ll /etc/yum.repos.d/ total 32 -rw-r--r-- 1 root root 954 Aug 11 2010 epel.repo -rw-r--r-- 1 root root 1054 Aug 11 2010 epel-testing.repo -rw-r--r-- 1 root root 254 Jul 12 23:26 iso.repo -rw-r--r-- 1 root root 254 Aug 29 2013 rhel-debuginfo.repo [root@Testing-Server software]# |
for RHEL6
Command is:
rpm -ivh http://dl.fedoraproject.org/pub/epel/6Server/i386/epel-release-6-8.noarch.rpm
二、初始化YUM库
Log:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@Testing-Server software]# yum repolist Loaded plugins: product-id, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. epel | 3.7 kB 00:00 epel/primary_db | 3.9 MB 00:17 repo id repo name status Cluster Cluster 32 ClusterStorage ClusterStorage 39 Server Server 3,358 VT VT 59 epel Extra Packages for Enterprise Linux 5 - x86_64 7,711 repolist: 11,199 [root@Testing-Server software]# [root@Testing-Server software]# |
三、安装GIT
Search By YUM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[root@Testing-Server software]# yum list | grep --color ^git This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. git.x86_64 1.8.2.1-1.el5 epel git-all.x86_64 1.8.2.1-1.el5 epel git-bugzilla.noarch 0-0.9.20091211git.el5 epel git-cvs.x86_64 1.8.2.1-1.el5 epel git-daemon.x86_64 1.8.2.1-1.el5 epel git-email.x86_64 1.8.2.1-1.el5 epel git-gui.x86_64 1.8.2.1-1.el5 epel git-p4.x86_64 1.8.2.1-1.el5 epel git-svn.x86_64 1.8.2.1-1.el5 epel git2cl.noarch 2.0-0.1.git8373c9f.el5 epel gitk.x86_64 1.8.2.1-1.el5 epel gitolite.noarch 2.3.1-1.el5 epel gitosis.noarch 0.2-6.20080825git.el5 epel gitweb.x86_64 1.8.2.1-1.el5 epel gitweb-caching.noarch 1.6.5.2-8.b1ab8b5.el5 epel [root@Testing-Server soft.ware]# |
Install GIT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
[root@Testing-Server software]# yum install git.x86_64 Loaded plugins: product-id, security, subscription-manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:1.8.2.1-1.el5 set to be updated --> Processing Dependency: perl-Git = 1.8.2.1-1.el5 for package: git --> Processing Dependency: perl(Term::ReadKey) for package: git --> Processing Dependency: perl(Git) for package: git --> Processing Dependency: perl(Error) for package: git --> Running transaction check ---> Package perl-Error.noarch 1:0.17010-1.el5 set to be updated ---> Package perl-Git.x86_64 0:1.8.2.1-1.el5 set to be updated ---> Package perl-TermReadKey.x86_64 0:2.30-4.el5 set to be updated --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: git x86_64 1.8.2.1-1.el5 epel 7.4 M Installing for dependencies: perl-Error noarch 1:0.17010-1.el5 epel 26 k perl-Git x86_64 1.8.2.1-1.el5 epel 49 k perl-TermReadKey x86_64 2.30-4.el5 epel 32 k Transaction Summary ================================================================================ Install 4 Package(s) Upgrade 0 Package(s) Total download size: 7.5 M Is this ok [y/N]: y Downloading Packages: (1/4): perl-Error-0.17010-1.el5.noarch.rpm | 26 kB 00:00 (2/4): perl-TermReadKey-2.30-4.el5.x86_64.rpm | 32 kB 00:00 (3/4): perl-Git-1.8.2.1-1.el5.x86_64.rpm | 49 kB 00:00 (4/4): git-1.8.2.1-1.el5.x86_64.rpm | 7.4 MB 01:08 -------------------------------------------------------------------------------- Total 110 kB/s | 7.5 MB 01:09 warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6 epel/gpgkey | 1.7 kB 00:00 Importing GPG key 0x217521F6 "Fedora EPEL <epel@fedoraproject.org>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Finished Transaction Test Transaction Test Succeeded Running Transaction Installing : perl-TermReadKey 1/4 Installing : perl-Error 2/4 Installing : git 3/4 Installing : perl-Git 4/4 Installed: git.x86_64 0:1.8.2.1-1.el5 Dependency Installed: perl-Error.noarch 1:0.17010-1.el5 perl-Git.x86_64 0:1.8.2.1-1.el5 perl-TermReadKey.x86_64 0:2.30-4.el5 Complete! [root@Testing-Server software]# [root@Testing-Server software]# rpm -qa | grep git xorg-x11-drv-digitaledge-1.1.0-1.1 xz-4.999.9-0.3.beta.20091007git.el5 git-1.8.2.1-1.el5 xz-libs-4.999.9-0.3.beta.20091007git.el5 [root@Testing-Server software]# |
Git Version
1 2 3 |
[root@Testing-Server software]# git --version git version 1.8.2.1 [root@Testing-Server software]# |
——————————————————————————————————————————————
Ending。