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/src/

[root@slave2 src]# wget  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.XNYKDX.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文件開始安裝即可


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM