1. 程式人生 > >github SSH連線遠端倉庫

github SSH連線遠端倉庫

1、新建ssh:

    ssh-keygen -t rsa -C "[email protected]"

2、輸入密碼,如果為空代表以後提交資訊到倉庫的時候,不用再次輸入密碼,那當然為空最好。

3、驗證是否設定成功:

ssh -T [email protected]

4、將id_rsa.pub資料複製到github設定SSH設定中,

5、設定全域性的user.name user.email 

$ git config user.name "dadi" 

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

6、然後就可以不用寫帳號密碼,而直接提交資料到遠端倉庫了

$ git push origin dev2:dev2
Warning: Permanently added the RSA host key for IP address '192.30.255.112' to t                                                                                                                           he list of known hosts.
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 615 bytes | 615.00 KiB/s, done.
Total 5 (delta 0), reused 0 (delta 0)
To github.com:LynPero/s2.git
 * [new branch]      dev2 -> dev2