本地Git与Github建立关联

准备

本地与Github建立连接,需要用到SSH公钥。一般安装完Git,会在用户目录中生成一个 .ssh的文件夹

如果没有此文件夹,可以通过命令创建

$ ssh-keygen -t rsa -C "[email protected]" # "" 里是注册Github的邮箱

配置

进入 .ssh,打开 id_rsa.pub,复制里面的key;回到Github,进入 Settings,选择 Add SSH key

为了验证是否成功,在 git bash 下输入:

看到 You've successfully authenticated, but GitHub does not provide shell access. 表示已经连上github

猜你喜欢

转载自www.cnblogs.com/Rain2017/p/10735210.html