在centos安装git

1、下载git源码

地址:https://www.kernel.org/pub/software/scm/git/


2、安装git

./configure --prefix=/home/program/git --without-tcltk
 make NO_MSGFMT=YesPlease NO_TCLTK=YesPlease NO_GETTEXT=YesPlease prefix=/home/program/git install

PS: NO_CURL=1 去除了,要不然git clone会不起作用


3、设置环境变量

vi /etc/profile.d/env_git.sh

GIT_HOME=/home/program/git

export GIT_HOME

PATH=$PATH:$GIT_HOME/bin:$GIT_HOME/libexec/git-core

export PATH


4、配置免密

vi ~/.gitconfig

[credential]

        helper = store

配置.gitconfig后,第一次输入密码,之后就可以不用输入


或用下面方法:

vi /root/.git-credentials

http://用户名:密码@192.168.1.100:3000


git | 2018-02-18 02:29:36