快速git

下载

bash 复制代码
sudo apt install git

配置

bash 复制代码
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
  • 没有空格可以不加双引号
  • 如果~/.ssh没有先创建(下一步用)

ssh方式制作密钥

github解释

bash 复制代码
#以邮箱作为标签或随意别的什么
 cd ~/.ssh
ssh-keygen -t ed25519 -C "your_email@example.com"
 ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

这里会让你输入密钥文件名和2次密码(用于克隆时候验证,或登录远程时会用)

bash 复制代码
cat *.pub

将公钥放入远程服务器端

编写配置文件(选一个或多个或自定义)

bash 复制代码
$ cat config
# GitHub
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/github

# Gitee
Host gitee.com
HostName gitee.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitee

# Gitee
Host gitcode.com
HostName gitcode.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitcode

验证登陆:(***为你的账号名字)

bash 复制代码
$ ssh -T git@gitcode.com
remote: Welcome to GitCode, ***
bash 复制代码
$ ssh -T git@github.com
Hi ***! You've successfully authenticated, but GitHub does not provide shell access.
bash 复制代码
$ ssh -T git@gitee.com  
Hi **! You've successfully authenticated, but GITEE.COM does not provide shell access.
 
 验证登录后可以放心克隆
相关推荐
Rverdoser7 小时前
制作网站的价格一般由什么组成
前端·git·github
Merrick10 小时前
git撤销第一次commit
git
艾莉丝努力练剑12 小时前
【Git:基本操作】深度解析Git:从初始Git到熟悉基本操作
大数据·linux·c++·人工智能·git·gitee·指令
大白要努力!13 小时前
将Git项目的所有远程分支打包成压缩包文件
git
牧羊人_myr13 小时前
Git指令集
git
边疆.15 小时前
【Linux】版本控制器Git和调试器—gdb/cgdb的使用
linux·服务器·git·gdb调试·cgdb
安冬的码畜日常1 天前
【JUnit实战3_22】 第十三章:用 JUnit 5 做持续集成(下):Jenkins + JUnit 5 + Git 持续集成本地实战演练完整复盘
git·测试工具·ci/cd·jenkins·集成测试·持续集成·junit5
wxxka1 天前
git使用
开发语言·git
舒一笑1 天前
用数据照亮成长之路:PandaCoder Git 统计工具窗口
git·后端·intellij idea