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 "youremail@example.com"
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 "sinx_cosy@163.com"
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 git@github.com # or $ssh git@github.com
Finally, we build a connection with GitHub. We can use command:
$git clone git@github.com:billyanyteen/github-services.git
git init to initialize a local repo of git.