Git Create ssh key

In Windows, open git bash.

git config

check current dir: $pwd  #/c/Users/huang

check global settings: $git config --list

if not setting user and email:

$git config --global user.name "yourname"

$git config --global user.email "[email protected]"

Then to produce the ssh key:

in current dir, check whether you have ssh key or not.

if you do not have ssh key, you will not have .ssh directory.

if you have, delete it and we will create a new one.

if you do not want to change, skip this step.

to generate ssh key: $ssh-key -t rsa -C "[email protected]"

then 3 returns;

You will get two files: id_ras and id_rsa.pub in .ssh directory.

If the 2 files are not in .ssh, copy them into .ssh directory:

$ssh-add filename

in github, copy and add you ssh key(pub).

Test ssh: ssh -T [email protected] # or $ssh [email protected]

Finally, we build a connection with GitHub. We can use command:

$git clone [email protected]:billyanyteen/github-services.git

git init to initialize a local repo of git.

你可能感兴趣的:(Git Create ssh key)