linux git安装 并且使用https方式 git pull 代码的免密操作

 安装依赖的包 缺少什么装什么
yum -y install curl-devel  expat-devel  gettext-devel  openssl-devel  zlib-devel  gcc perl-ExtUtils-MakeMaker

 

验证Git是否安装成功,命令如下:

git --version

卸载 git

yum remove git 

由于版本低就卸载了

 [root@slave2 ~]# cd  /usr/local/src/

[root@slave2 src]# wget  https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz

出现cannot verify mirrors.edge.kernel.org's certificate错误 使用下面命令 增加--no-check-certificate

或者 wget  --no-check-certificate  https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz

[root@slave2 src]# tar -zxvf git-2.9.0.tar.gz

[root@slave2 src]# cd  git-2.9.0

[root@slave2 git-2.9.0]# ./configure --prefix=/usr/local/git/

[root@slave2 git-2.9.0]# make && make install

这里如果没有configure 文件

方法1:参考文章最底下命令生成configure 方法

方法2:或者使用下面方法代替上面 两行操作

make prefix=/usr/local/git all
make prefix=/usr/local/git install

[root@slave2 git-2.9.0]#  vim /etc/profile

  在最后一行加入

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

       或者不用vim打开文本直接加入到文本最后 echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile  

  让该配置文件立即生效

  source /etc/profile

[root@slave2 git-2.9.0]# git --version
git version 2.9.0

 成功

没啥用可以把解压的git-2.9.0 删了 看心情

[root@localhost src]# rm -rf git-2.9.0

=========================================================================

使用这中http方式 拉去代码时  git clone http://username@ip:host/xxxx项目

如下配置:

进入服务器的项目目录,执行

[root@slave5 ~]#  git config --global credential.helper store

执行之后,继续项目代码路径git pull

[root@slave5 BigData.ETL]# git pull

重新输入一遍账号密码。然后往后就不需要再输入了

 

参考:https://blog.csdn.net/LJFPHP/article/details/79103679

========================遇到=======================

生成configure文件的步骤

https://blog.csdn.net/BabyBirdToFly/article/details/69941756
在软件包内执行如下命令:

autoreconf  -iv

或者如下方式

aclocal
autoconf --> 生成configure文件
autoheader(出现什么AC_CONFIG_HEADERS not found in configure.ac 可以忽略)
automake --add-missing(出现ltmain.sh not found,需要执行autoreconf -ivf) --> 会生成Makefile
.in 文件
然后就会生成configure文件,继续按照软件的INSTALL/README文件开始安装即可

 

posted @ 2018-10-20 14:49  zsls-lang  阅读(3007)  评论(0编辑  收藏  举报