git的ssh认证与用户配置

git是分布式的代码管理工具,远程的代码管理是基于ssh的,所以要使用远程的git则需要ssh的配置。

github的ssh配置如下:

一 、设置git的user name和email:

      $ git config --global user.name "xuhaiyan"
      $ git config --global user.email "haiyan.xu.vip@gmail.com"
              或者打开~/.gitconfig 编辑
  [user]
      name = aa
      email = xxx@dd0.cn

二、生成ssh key:

ssh-keygen -t rsa -C “xxx@dd0.cn”

产生过程中输入密码 
拷贝 ~/.ssh/id_rsa.pub 到ssh keys中






三、配置本地用户密码

  1. touch ~/.git-credentials
  2. echo "http://$username:$password@$localhost" >> ~/.git-credentials
  3. git config --global credential.helper store

You May Also Like

About the Author: daidai5771

发表评论

电子邮件地址不会被公开。 必填项已用*标注