If SSH management is used, you need to configure the SSH key.
1. Open git bash
2. Generate an SSH key
ssh-keygen -t rsa -b 4096 -C "[email protected]"
Copy the code
[email protected] is your registered email address on Github.
Complete the creation process as follows:
$ ssh-keygen -t rsa -b 4096 -C "[email protected]" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa. Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub. The key fingerprint is: SHA256:chS9dRlB6Ee+E6/Ob9plXh5HXgDhhOk6mpST+oqrCxA [email protected] The key's randomart image is: +---[RSA 4096]----+ | .. o++++ | | .+oo.+ | |E .. +.+. | | . . o . +. | |. .oS. . +o| |. =oo ooo| |. o + . +*| |. .. o .. =*| |ooo.. o. .++=| +----[SHA256]-----+Copy the code
The above is generated by default in the user’s home directory. SSH directory, you can enter a custom location.
3. Add SSH keys to Github
Copy the file c/Users/Administrator /. SSH/id_rsa pub content, add the key to: making > Settings > SSH and GPG keys > New SSH key > paste.
4. Test SSH connections
$ ssh -T [email protected]
Copy the code
If the following information is displayed, the connection is successful:
$ ssh -T [email protected]
Hi Javastack! You've successfully authenticated, but GitHub does not provide shell access.
Copy the code
Now you can clone and commit code over SSH.
For more details, see official Configuration:
https://help.github.com/articles/connecting-to-github-with-ssh/
Copy the code
Recommended reading
Dry goods: 2TB architect four-stage video tutorial
Interview: the most complete Java multithreaded interview questions and answers
Interview: the most comprehensive ali advanced Java interview questions in history
Interview: The most complete Spring interview questions in history
Tutorial: The most complete Spring Boot complete video tutorial
Books: 15 must-read books for advanced Java architects
Tools: Recommended an online creation flow chart, mind mapping software
Share Java dry goods, high concurrency programming, hot technology tutorials, microservices and distributed technology, architecture design, blockchain technology, artificial intelligence, big data, Java interview questions, and cutting-edge hot news.