Git-ssh 配置及使用
一、设置Git的 user.name 和 user.email :(如果是第一次的话)
$ git config --global user.name "用户名"
$ git config --global user.email "邮箱地址"
修改用户名或者邮箱地址:
$ git config --global --replace-all user.name "用户名"
$ git config --global --replace-all user.email "邮箱地址"
删除用户名或者邮箱地址:
$ git config --global --unset user.name "用户名"
$ git config --global --unset user.email "邮箱地址"
查看已经配置的信息:
git config --list
二、生产 ssh **
$ ssh-****** -t rsa -C "[email protected]
连续3个回车。如果不需要密码的话。
最后得到了两个文件:id_rsa
和id_rsa.pub
。
进入到 .ssh 文件夹下,该文件夹是隐藏文件。
执行 ls -al 命令查看文件夹中的内容:
打开 id_rsa.pub文件的到**:
cat id_rsa.pub