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.name
anduser.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
- View in terminal
$ cd ~/.ssh switch directory to this path
$ vim id_rsa.pub displays the contents of this file to the terminal
- 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