github访问配置

1.本地配置用户信息

$ git config --global user.name "yourname"
$ git config --global user.email "your@email"

  

2.生成公钥

cd ~/.ssh
ssh-keygen -t rsa -C "[email protected]"

3.添加公钥到远程仓库

3.1查看公钥

$ cat ~/.ssh/id_rsa.pub

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0X6L1zLL4VHuvGb8aJH3ippTozmReSUzgntvk434aJ/v7kOdJ/MTyBlWXFCR+HAo3FXRitBqxiX1nKhXpHAZsMciLq8vR3c8E7CjZN733f5AL8uEYJA+YZevY5UCvEg+umT7PHghKYaJwaCxV7sjYP7Z6V79OMCEAGDNXC26IBMdMgOluQjp6o6j2KAdtRBdCDS/QIU5THQDxJ9lBXjk1fiq9tITo/aXBvjZeD+gH/Apkh/0GbO8VQLiYYmNfqqAHHeXdltORn8N7C9lOa/UW3KM7QdXo6J0GFlBVQeTE/IGqhMS5PMln3 admin@admin-PC

 3.2添加公钥

登陆github帐户,点击头像, profile setting -> SSH keys ,把上面的秘钥添加进去即可

转载于:https://www.cnblogs.com/zhscn/p/8629067.html

你可能感兴趣的:(运维,git)