參考了下面這篇文章,不對(duì)的地方做了改正
在服務(wù)器上git clone github項(xiàng)目的過(guò)程-CSDN博客
1. 下載解壓
wget https://www.kernel.org/pub/software/scm/git/git-2.34.1.tar.gz
tar -zxvf git-2.34.1.tar.gz
2. 安裝
cd git-2.34.1/
./configure
make configure
?這里也許會(huì)遇到一個(gè)錯(cuò)誤,報(bào)錯(cuò) “/bin/sh: 1: autoconf: not found make: *** [Makefile:2410: configure] Error 127”。這是由于 autoconf 未安裝。使用如下命令安裝:
sudo apt-get update sudo apt-get install autoconf
安裝后再次執(zhí)行 make configure,結(jié)果如下,就可以開心地繼續(xù)啦?
./configure --prefix=home/git
make -j16 && make install
?make 的時(shí)候可能又會(huì)碰到一個(gè)報(bào)錯(cuò) “/bin/sh: 1: msgfmt: not found MSGFMT po/build/locale/is/LC_MESSAGES/git.mo make: *** [Makefile:2691: po/build/locale/de/LC_MESSAGES/git.mo] Error 127 make: *** Waiting for unfinished jobs....” 這是由于gettext未安裝,使用如下命令
sudo apt-get install gettext
再次 make 就能成功(攤) 別忘記 make install
3. ssh key
首先創(chuàng)建 key
ssh-keygen -t rsa -C "github賬戶的郵箱地址"
一路 enter 就行?
接著查看剛創(chuàng)建的 key
cd ~
cd .ssh
cat id_rsa.pub
復(fù)制這個(gè) key,在 github 點(diǎn)擊我的頭像 - settings - SSH and GPG keys - new SSH key?,把秘鑰貼進(jìn)去
名稱不重要,add 后就有權(quán)限 git clone 了。?git 就結(jié)束了嗚嗚文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-790924.html
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-790924.html
到了這里,關(guān)于服務(wù)器 配置git的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!