Configuring Git and setting up SSH on Mac

1. Install git

Mac comes with git, so you don’t need to download and install it yourself.

2. Configure account

In the terminal, type git config --global --list,to see if it is configured user.nameanduser.email

git config --global user.name "account name" ->Set user name

git config --global user.email "account email" ->This is the email address

3. Generate SSH KEY

// 在终端输入
$ ssh-keygen -t rsa -C 邮箱

例如:ssh-keygen -t rsa -C [email protected]

Note : Fill in the email address here with the email address you will use when submitting the code.

4. View ssh key

  1. View in terminal

$ cd ~/.ssh switch directory to this path

$ vim id_rsa.pub displays the contents of this file to the terminal

  1. View in .pub file

Go to the path where the .shh file is located (go to the path ~/.ssh), and then open the .pub file with xcode

Five, set up on github

add ssh public key

Guess you like

Origin blog.csdn.net/weixin_38649188/article/details/129750349