Linux上安装git

Linux上安装git

Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。

而国外的GitHub和国内的Coding都是项目的托管平台。但是在使用Git工具的时候,第一步要学会如何安装git,下面使用编译方式安装git。

1、介绍

https://coding.net/

 

  使用Coding管理项目,上面要求使用的git版本为1.8.0以上,而很多yum源上自动安装的git版本为1.7,所以需要掌握手动编译安装git方法。

2、安装git依赖包

  yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker

3、删除已有的git

  yum remove git

4、下载git源码

  切换到你的包文件存放目录下

    cd /usr/src

  下载git安装包

    wget https://www.kernel.org/pub/software/scm/git/git-2.8.3.tar.gz

  解压git安装包

    tar -zxvf git-2.8.3.tar.gz

    cd git-2.8.3

  配置git安装路径

    ./configure prefix=/usr/local/git/

  编译并且安装

    make && make install

  查看git版本号

  git --version

  git已经安装完毕

5、将git指令添加到bash中

  vi /etc/profile

  在最后一行加入

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

  让该配置文件立即生效

  source /etc/profile

maven安装

下载网站:http://maven.apache.org/download.cgi
旧版本:https://mirrors.tuna.tsinghua.edu.cn/apache/maven/
//1、进入一个目录
cd /usr/local
//2、创建一个文件夹
mkdir maven
//3、下载二进制编译文件
wget https://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz
//4、解压
tar -zxvf apache-maven-3.5.4-bin.tar.gz
//5、配置环境变量
vim /etc/profile
//新增行MAVEN_HOME,等于号后面是maven解压的文件夹地址
export MAVEN_HOME=/usr/local/maven/apache-maven-3.5.4
//找到PATH行,追加$MAVEN_HOME/bin
例如:
PATH=$JAVA_HOME/bin:$MAVEN_HOME/bin:$PATH
//6、重新刷新配置文件
source /etc/profile

//7、配置阿里云仓库 修改 settings.xml

<mirror>  
    <id>nexus-aliyun</id>  
    <mirrorOf>central</mirrorOf>    
    <name>Nexus aliyun</name>  
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>  
</mirror>

//8、验证maven:

mvn -v

Tomcat 安装

https://tomcat.apache.org/download-80.cgi

历史版本地址

http://archive.apache.org/dist/tomcat/

下载:

wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.41/bin/apache-tomcat-8.5.41.tar.gz

解压、配置环境变量 、source一下

打war包

mvn clean package

猜你喜欢

转载自www.cnblogs.com/gaogaoyanjiu/p/9463879.html