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 "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.

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容