How to Install Git on CentOS 6

Introduction
Git is an open source, distributed version control system (VCS). It’s commonly used for source code management (SCM), with sites like GitHub offering a social coding experience, and popular projects such as Perl, Ruby on Rails, and the Linux kernel using it.

Pre-Flight Check
These instructions are intended for installing Git on CentOS 6.
I’ll be working from a Liquid Web Core Managed CentOS 6.5 server, and I’ll be logged in as root.

If you’re using CentOS 5, then refer to this tutorial on installing git from source on CentOS 5.

Installation
First, you’ll follow a simple best practice: ensuring the existing packages are up to date before installing anything new.

yum update

Then it’s a matter of just running one command for installation via yum:

yum install git

You’ll be asked to confirm the download and installation; simply enter y to confirm. Once this command is complete, git will be installed and ready to use!

As of the writing of this tutorial, the current version of Git available in the Liquid Web yum repositories is: git version 1.7.1. You can check the version of git that was installed by using the following command:

git --version

Configuration
To prevent any commit errors, it’s a good idea to setup your user for git. We’ll setup the user testuser with the e-mail address [email protected] .

git config --global user.name "testuser" (set user name for ervery repository)
git config --global user.email "[email protected]"

Next we’ll verify the configuration changes by viewing the .gitconfig . Since you may have been roaming around your server’s file system before starting this tutorial, use the cd command to return to your home directory:

cd

And then view the .gitconfig :

cat .gitconfig

You can also view the same details of your configuration by using the following command:

git config --list

Be Sociable, Share!

时间: 2024-08-02 02:50:43

How to Install Git on CentOS 6的相关文章

how to install git 1.8 rpm

git版本在低于1.8之前,对于私有项目会出现401的pull失败错误,只能通过升级git版本来解决 It appears that git18 is no longer available from RPMForge, at least in CentOS 6.6. Luckily, I came across the following instructions from a GitLab CentOS recipe: Download PUIAS repo: wget -O /etc/yu

git安装(CentOS 7)

git安装 # 系统版本 [[email protected] git]$ cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) # 安装依赖(获取最新版本的时候才需要,直接用yum安装则忽略这些依赖) [[email protected] ~]$ sudo yum install curl-devel expat-devel perl-devel asciidoc xmlto docbook2X # 安装完docbook2X的

Install ssdb-rocks on CentOS 6

Install ssdb-rocks on CentOS 6 C.C.  发表于 2014年08月10日 20:14 | Hits: 649 为了优化节操精选的弹幕系统,打算更换到Facebook的RocksDB测试,为了支持多台Web Server的场景,打算直接上ssdb-rocks来完成目的,如果有这个需求的朋友还遇到过坑,可以参考一下步骤: RocksDB需要的依赖 yum install zlib zlib-devel bzip2 bzip2-devel gflags gflags-d

How to Install MySQL on CentOS 7

How to Install MySQL on CentOS 7 Updated Thursday, August 27th, 2015 by Linode Use promo code DOCS10 for $10 credit on a new account. Try this Guide Contribute on GitHub View Project | View File | Edit File MySQL is a popular database management syst

cygwin install git

Installation with Cygwin If you're comfortable with Cygwin, then use it to install git, ssh, wget and python. Install pip, and use pip to install git-review: $ wget http://peak.telecommunity.com/dist/ez_setup.py $ python ez_setup.py $ easy_install pi

How to install MP4box on CentOS 6

How to install MP4box on CentOS 6 MP4Box is a MP4 multiplexer. It can import MPEG-4 video, DivX, XviD, 3ivx, h264 etc, audio streams and subtitles into the .mp4 container. The end result is a compliant MP4 stream. It can also extract streams from a .

Install Ceph on CentOS 6.5

vi /etc/yum.repos.d/ceph-extras.repo[ceph-extras]name=Ceph Extras Packagesbaseurl=file:///ceph/ceph-extrasenabled=1priority=2gpgcheck=0type=rpm-md [ceph-extras-noarch]name=Ceph Extras noarchbaseurl=file:///ceph/ceph-extras-noarchenabled=1priority=2gp

Install transmission-daemon on CentOS

Fail to install rTorrent on CentOS 5.4, just install transmission-daemon libevent wget --no-check-certificate https://sourceforge.net/projects/levent/files/libevent/libevent-2.0/libevent-2.0.22-stable.tar.gz tar xzf libevent-2.0.22-stable.tar.gz cd l

Install nginx-clojure on CentOS 7

Install nginx-clojure on CentOS 7 1. install open-jdk-7 sudo yum install java-1.7.0-openjdk-devel 2. download nginx-clojure https://nginx-clojure.github.io/quickstart.html 3. download clojure 1.6.0.jar http://clojure.org/downloads 4. config nginx.con