Ubuntu配置Git
2018-02-25  本文已影响181人 
吴意外
- 安装Git
- sudo apt-get install git
 
 - 配置git信息
- git config --global user.name "Your Name"
 - git config --global user.email "email@example.com"
 - git config --list 查看设置
 
 - 配置ssh
- ssh-keygen -t rsa -C "youremail@example.com"
 
 - 会看到有id_rsa(私钥),id_rsa.pub(公钥) 拷贝公钥
 - 在自己的github上添加公钥,add key.
 - 以后提交代码就不用输入账号密码了。
 - 如果添加公钥依然无效
- 打开项目目录下隐藏的文件夹.git
 - 找到config文件
 - 把项目url从http方式改成ssh方式