新安装的git进行配置

3 阅读1分钟

配置用户名和邮箱

Last login: Mon Nov  5 13:13:43 on ttys000
wujiayus-MacBook-Pro:~ wjy$ git config --global user.name 'wujy'
wujiayus-MacBook-Pro:~ wjy$ git config --global user.email 'wujy@test.com'

生成SSHKey

wujiayus-MacBook-Pro:~ wjy$ ssh-keygen -t rsa -C "wujy@test.com" 

中间会遇到一些,需要配置的问题,一般情况一路按回车就可以了

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/wjy/.ssh/id_rsa): 
Created directory '/Users/wjy/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/wjy/.ssh/id_rsa.
Your public key has been saved in /Users/wjy/.ssh/id_rsa.pub.

配置SSHKey

切换到一下路径

wujiayus-MacBook-Pro:~ wjy$ cd /Users/wjy/.ssh

打开文件

wujiayus-MacBook-Pro:.ssh wjy$ cat id_rsa.pub

将下面的内通复制到github上SSHKey的地方