Linux 之搭建 Git 環境

2021-10-07 21:53:18 字數 1262 閱讀 5915

檢視是否已經安裝過 git

[root@centos]

git --version

git version 1.8.3

解除安裝舊版 git
[root@centos] yum remove git
[root@centos] yum -y install

git

安裝依賴包(根據實際情況安裝,有些可能已經安裝過來):
[root@centos] yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

[root@centos] yum install gcc-c++ perl-extutils-makemaker

[root@centos]

cd /opt/

[root@centos]

wget

解壓:
[root@centos]

tar -zxvf git-2.25.0.tar.gz

編譯安裝(安裝在 /usr/local/git 目錄下):
[root@centos]

mkdir /usr/local/git

[root@centos]

cd git-2.25.0

[root@centos]

make

prefix

=/usr/local/git all

[root@centos]

make

prefix

=/usr/local/git install

安裝成功後配置 git 環境變數:
[root@centos]

vim /etc/profile

在最後一行新增:
export

path

=/usr/local/git/bin:$path

生效檔案:
[root@centos]

source /etc/profile

檢視版本:
[root@centos]

git --version

git version 2.25.0

生成 rsa 金鑰:
[root@centos] ssh-keygen -t rsa

在linux下搭建git環境

1 建立github賬號,2 linux建立ssh金鑰 plain view plain copy ssh keygen 一直預設就可以了 3 將公鑰加入到github賬戶資訊account settings ssh key 4 測試驗證是否成功。plain view plain copy ssh ...

Git 環境搭建

一 分別執行下面命令 生成不同賬號的金鑰和公鑰 ssh keygen t rsa c isme mail.com f id rsa me ssh keygen t rsa c company mail.com f id rsa company 注釋 利用了ssh keygen 命令生成了金鑰和公鑰 ...

git環境搭建

linux kernel 的官方 git位址是 可以從這個位址拿到 kernel 的 倉庫。git clone git 在家目錄下 也就是自己的目錄下 將git執行檔案放在家目錄的bin下面,沒有就自己創乙個bin目錄 將檔案git completion.bash修改檔名為 git completi...