1.git
1.1查看是否安装git
rpm -qa|grep git
有如图所示的红色git+版本号就说明已经安装过了
1.2安装git(已安装请忽略)
yum install git
1.3查看安装版本
git --version
1.4配置git账号
git config --global user.name "Your Name"
git config --global user.email "email@example.com"
1.5设置保存账号密码并查看配置
git config credential.helper store
git config --list
1.6配置ssh公钥
1.6.1在本地生成ssh key,生成公钥和私钥
ssh-keygen -t rsa -C "email@example.com"
按三次回车键生成ssh key,在/root/.ssh/目录下
1.6.2将/root/.ssh/目录下的公钥id_rsa.pub里面的内容复制添加到git或者码云等代码托管的平台上即可,如下图
1.6.3
设置好即可使用git啦。设置好了保存密码并且添加了ssh key公钥的话,第一次使用一般需要输入邮箱和密码,后面在操作就不需要了。
1.7简单使用
下载源码
git clone 链接
迁出某一分支
git fetch origin release-1.10
git checkout -b release-1.10 origin/release-1.10
2.maven
2.1下载对应版本maven
https://archive.apache.org/dist/maven/maven-3/
2.2解压到某一文件夹
tar -xzvf apache-maven-3.5.3-bin.tar.gz
2.3配置环境变量
vi /etc/profile
MAVEN_HOME=/usr/local/maven/apache-maven-3.5.3
export PATH=${MAVEN_HOME}/bin:${PATH}
source /etc/profile
mvn –v
2.4配置Maven
vi /usr/local/maven/apache-maven-3.5.3/conf/settings.xml
配置阿里云镜像,下载资源会很快
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
指定本地仓库位置
<localRepository>/usr/local/maven/repository</localRepository>
2.5简单使用
跳过测试编译代码
mvn clean package -DskipTests