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中
三、配置本地用户密码
touch ~/.git-credentials
echo "http://$username:$password@$localhost" >> ~/.git-credentials
git config --global credential.helper store