您的位置:首页 > 编程语言

push到Github每次都要输入密码

2015-10-29 09:59 295 查看

问题描述

push 到 Github 每次都要输入密码,原因是使用了 Https 的方式添加远程仓库

git remote add origin https://github.com/weiheli/UCenter.git


查看 push 和 fetch 方式

git remote -v
// 输出
origin  https://github.com/weiheli/UCenter.git (fetch)
origin  https://github.com/weiheli/UCenter.git (push)


换成 ssh 方式

创建SSH Key,把
id_rsa.pub
中的内容添加到 Github 的
Deploy keys


然后

git remote rm origin
git remote add origin git@github.com:weiheli/UCenter.git
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: