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.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容