Git安裝配置
apt-get install git # 安裝Git
git --version # 安裝成功后顯示版本 git version 2.34.1
git config --global user.name "name" # 配置用戶名
git config --global user.email "email" # 配置用戶郵箱
git config --list # 查看全局配置
ssh-keygen -t rsa -C email # 生成ssh-key 目錄root/.ssh/id_rsa.pub
到Github添加ssh-key 頭像->settings->SSH and GPG keys->New SSH key
測試連接文章來源:http://www.zghlxwxcb.cn/news/detail-543293.html
ssh -T git@github.com # 測試鏈接
You've successfully authenticated, but GitHub does not provide shell access. # 成功
新增配置(上一步成功便不需要此步驟)文章來源地址http://www.zghlxwxcb.cn/news/detail-543293.html
cd root/.ssh
vim config # 寫入以下內(nèi)容
Host github.com
User jeniluo@163.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
到了這里,關(guān)于Ubuntu22.04安裝Git及配置的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!