1. Check if SSH keys exist
Enter the following command, if there is a file id_rsa.pub
or id_dsa.pub
, there is no need to enter the second step to generate an SSH key
ls -al ~/.ssh
2. Generate a new ssh key
生成public/private rsa key pair
Type in the command line
ssh-keygen -t rsa -C "[email protected]"
id_rsa
By default, two files and id_rsa.pub
two files will be generated in the corresponding path (/your_home_path)
3. Set git account information
Type in the command line
git config --global user.name "username" git config --global user.email "email"