1.  创建SSH密钥

    ssh-keygen -t rsa -C "xxxx@hotmail.com" -f ~/.ssh/user-github

    -t 指定密钥类型,默认即 rsa ,可以省略
    -C 设置注释文字,比如你的邮箱
    -f 指定密钥文件存储文件名,会生成 test-github 和 test-github.pub 两个文件

    然后一直回车,密钥文件就在指定路径下生成了,把生成的user-github.pub文件的内容添加到github服务器的“SSH KEYS”选项中。

    这样的话,使用 git clone <server's ssh address>的仓库,提交代码到github服务器上时就不需要输入密码了。

 

2.  账户配置

     1) git config --global user.name Jason

          配置用户名,在生成patch或commit时会显示在Log中。

     2) git config --global user.email xxxx@hotmail.com

      配置用户邮箱,用于发送补丁;同时,在生成patch或commit时会显示在Log中。

     3) git config --list

    可以查看用户已经设置的选项

 

     PS: --global 选项表示对所有的

 

引用:http://blog.csdn.net/lhf_tiger/article/details/7082703

引用:http://blog.csdn.net/taurance/article/details/14451627

 

posted on 2015-10-07 21:42  全能码农  阅读(128)  评论(0编辑  收藏  举报