原本是由http Push 改为ssh Push
- 配置用户名密码
git config --global user.name “lf”
git config --global user.email “###@qq.com” - 生成ssh密钥
ssh-keygen –t rsa –C “###@qq.com” - 打印公钥
cat ~/.ssh/id_rsa.pub - 复制公钥要剪切板
clip < ~/.ssh/id_rsa.pub - 设置remote url
git remote set-url origin git@github.com:GitRepoName.git - git push origin master
原文: http://www.cnblogs.com/lihaiping/p/6021813.html