Git clone code from Github without authentication
Bing 14 Jul 2017Generate an SSH key
Linux/Mac
Open terminal to create SSH Keys.
cd ~ #Your home directory
ssh-keygen -t rsa #Press enter for all values
For Windows
(Only works if the commit program is capable of using certificates/private & public ssh keys)
- Use Putty Gen to generate a key;
- Export the key as an open SSH key.
Here is a walkthrough on putty gen for above steps.
Associate the SSH key with the remote repository
The following steps will be conducted by an administrator of the Github repository that you want to clone. If you do not have any administrative privileges, please give your id_ras.pub to administrator.
- Using your account and password to login Github
- Go to setting page
- Click SSH and GPK keys item on your left vertical panel
- In the SSH keys section of your right page, click New SSH key button to add a new ssh key to your github account.
- Type in the title name and the key content from your id_ras.pub file, then click Add SSH key.
Set your remote URL to a form that supports SSH
Go to repository that you want to clone, then click clone or download button on your right page and choose “SSH” format to checkout the code. The SSH format looks like the following example.
git@github.com:bingrao/bingrao.github.io.git
The opposed format, HTTPS, is:
https://github.com/bingrao/bingrao.github.io.git
When you got SSH link, you can use the following command to checkout code.
git clone git@github.com:bingrao/bingrao.github.io.git
Tags:
Stats:
0 comments