zoukankan      html  css  js  c++  java
  • centos7安装git

    下载GIT

    下载地址:https://git-scm.com/download/linux

    如上图,整个网页最下面有centos版本的tar包,点红框链接,进去就是下面这个链接。

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

    选择最新版本,我喜欢在windows下载好后,拷贝到centos。

    拷贝GIT

    [root@localhost /]# mkdir /soft

    利用WinSCP将git拷贝到centos,放在/soft目录。

    安装gcc、g++以及编译git所需要的包

    安装gcc

    [root@localhost ~]# yum install gcc

    安装g++

    [root@localhost /]# yum install gcc-c++

    安装编译所需的包

    [root@localhost /]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

    [root@localhost /]# yum install gcc perl-ExtUtils-MakeMaker

    解压GIT源码包

    [root@localhost soft]# cd /soft

    [root@localhost soft]# tar zxvf git-2.14.0.tar.gz

    编译并安装GIT

    [root@localhost soft]# cd git-2.14.0/

    [root@localhost git-2.14.0]# ./configure --prefix=/usr/local/git-2.14.0 && make install

    这句命令的意思是:编译并指定安装目录、安装

    设置GIT全局变量

    [root@localhost bin]# vi /etc/profile

    然后输入双引号里面的命令:”:$”,跳到文件最后一行

    export PATH=$PATH:/usr/local/git-2.14.0/bin

    将上面这行代码拷贝到文件末尾,并保存

    [root@localhost bin]# source /etc/profile

    查看GIT版本号

    [root@localhost bin]# git --version

    删除git的解压文件

    [root@localhost local]# cd /soft

    [root@localhost soft]# rm -rf git-2.14.0

    so easy...

  • 相关阅读:
    python网页抓取之英汉字典
    快速搭建建SSH服务
    dos文件批量转换成unix文件
    svn强制提交备注信息
    win7/8下VirtualBox虚拟共享文件夹设置
    CentOS SVN服务器安装配置小记
    CentOS中vsftp安装与配置
    sql执行顺序
    PHP最佳实践(译)
    python连接mysql数据库
  • 原文地址:https://www.cnblogs.com/subendong/p/7667443.html
Copyright © 2011-2022 走看看