Git is an open source, distributed version control system. It’s all the rage right now with sites like GitHub offering a social coding experience, and popular projects such as Perl, Ruby on Rails, and the Linux kernel using it.
In addition to it being easy to use, it’s also a cinch to install. Let’s start by logging into your server via SSH. Make sure you log in as root or another user with sudo access. First, we need to install a few dependencies Git needs. We can do this easily using yum:
yum -y install zlib-devel openssl-devel cpio expat-devel gettext-devel
Next, we’ll change directories to /usr/local/src, download the latest Git source code and untar it, and then change into our newly created directory:
cd /usr/local/src
wget http://git-core.googlecode.com/files/git-1.7.9.tar.gz
tar xvzf git-1.7.9.tar.gz
cd git-1.7.9
*. gcc 설치가 안되 있다면 gcc먼저 설치
yum install gcc
*. make 시 error: X11/Xlib.h: 그런 파일이나 디렉터리가 없습니다. 오류 난다면
yum install libX11-devel 설치. 후 ./configure부터 다시 시작.
We’re almost there! Now we need to configure a makefile for our system, compile the code and install it. It sounds daunting, but it’s quite simple:
./configure
make
make install
And last, but not least, let’s check to make sure our installation is a success. Change to your home directory, create a new directory, and initialize it as a Git repository:
cd
mkdir git-test
cd git-test
git init
If all goes well, you should see similar output:
Initialized empty Git repository in /root/git-test/.git/
That’s it! If you’re new to Git, there are several sites to help you get started, including Git Ready and GitHub Guides.
출처 : http://www.liquidweb.com/kb/install-git-on-centos-5/
'형상관리' 카테고리의 다른 글
[형상관리] linux - svn 명령어사용 (0) | 2014.06.26 |
---|---|
[형상관리] Linux - Centos svn (0) | 2014.06.23 |
[형상관리] GitLab (0) | 2014.06.10 |
[형상관리] Git 설명 (0) | 2013.11.27 |
[형상관리] Git 설치 및 사용 (0) | 2013.11.27 |