首页 > 系统服务 > 详细

Linux 之 Git 配置

时间:2021-04-16 12:42:21      阅读:15      评论:0      收藏:0      [点我收藏+]

Linux 之 Git 配置

1. 安装 Git

sudo apt install git

2. 配置 用户名、邮箱、默认编辑工具

$ git config --global user.name "Github 用户名"
$ git config --global user.email "Github 登录邮箱"
$ git config --global core.editor "vim"

# 查看配置信息
$ git config --global -l

技术分享图片

3. 创建版本库

# 在版本库文件夹内
$ git init

4. 连接远程仓库

$ ssh-keygen -t rsa -C "Github 登录邮箱"

Generating public/private rsa key pair.
Enter file in which to save the key (/home/xklsm/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/xklsm/.ssh/id_rsa
Your public key has been saved in /home/xklsm/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:IVWXumAg9N3TBePFzA0nE1FoXPHM2lL4kYEl7Pm2doY 【Github登录邮箱】
The key‘s randomart image is:
+---[RSA 3072]----+
|   ..   ... =O@%=|
|    ...o . +.*OB=|
|     .o.o o.+.oo=|
|       .o... o =.|
|       .S. .  + o|
|          .    + |
|              ...|
|              Eoo|
|              ...|
+----[SHA256]-----+

5. 添加 public key 到 Github

# 拷贝 $HOME/.ssh/id_rsa.pub 文件中内容,并添加key到Github

Linux 之 Git 配置

原文:https://www.cnblogs.com/xklsm/p/14665555.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!