When we use a warehouse such as GitHub to pull a replacement code, it may require SSH authentication, so we need to generate a local SSH key.
So how to generate SSH key??
1, first to install the Git tool (previous: Git installation steps)
2. Right mouse, check "Git Bash here" or open it in Windows "start"---> "so program" or install directory;
3. Enter the. SSH folder
Command: CD ~/.ssh/
If you are prompted with "No such file or directory", the. ssh folder does not exist, you need to create one manually;
Command: mkdir ~/.ssh
4, configure the global name and email, here is your GitHub or bitbucket name and email
$ git config--global user.name "Your name"
$ git config--global user.email "[Email protected]"
5. Generate key
Ssh-keygen-t rsa-c "[email protected]"
Press three times in succession, the password set here is empty, and the key is created;
Finally, two documents were obtained: Id_rsa and id_rsa.pub;
6. Open the Suwy directory, enter the. SSH folder, open the id_rsa.pub with Notepad, copy the contents of the content to your github, and SSH setup is complete.
Because I use the Gerrit, so add ssh location here:
7, self-detection add key is successful
Is Git clone a Gerrit on the project, see whether can clone down, can demonstrate success.
Windows7 Environment: Git SSH Create key step