-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-login-with-ssh
18 lines (18 loc) · 1.03 KB
/
github-login-with-ssh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1.把openssh生成的公钥~/.ssh/id_rsa.pub内容复制到github.com上,settings-SSH Keys-Add SSh key然后把id_rsa.pub的内容粘帖
如果id_rsa.pub没在本地存放,就去vps上把~/.ssh/authorized_keys的内容复制到github上
2.ssh -T git@github.com测试下,看到Hi username! You've successfully authenticated, but GitHub does
not provide shell access.说明可以用了
3.改变https登录为ssh
[jusss@localhost tmp]$ git remote -v
tmp https://github.com/jusss/tmp.git (fetch)
tmp https://github.com/jusss/tmp.git (push)
[jusss@localhost tmp]$ git remote set-url tmp git@github.com:jusss/tmp.git
[jusss@localhost tmp]$ git remote -v
tmp git@github.com:jusss/tmp.git (fetch)
tmp git@github.com:jusss/tmp.git (push)
[jusss@localhost tmp]$ git push tmp master
[jusss@localhost python]$ man git-remote
[jusss@localhost python]$ git remote remove py
[jusss@localhost python]$ git remote add python git@github.com:jusss/python.git
[jusss@localhost python]$ git push python master
手动取消https的登录,改成ssh的也行