新手问题 新建一个仓库后,推迭到 Github 时要输用户名密码

johnlu · July 30, 2013 · Last by JohnLu replied at July 30, 2013 · 2831 hits

原来本地也有一个 Git 工作树仓库,推迭到 Github 时使用 SSH-Key; 把原来的 Git 仓库删除后,再新建一个一样的,但推迭到 Github 时却变成了要输入用户名密码; 感觉没有使用 SSH-Key 方便 请问大牛如何再设置成使用 SSH-Key??

git remote set-url origin [email protected]:lushilong/xxx.git

#1 楼 @yesmeck 成功了,谢谢!再问问如果是用: git remote add origin https://github.com/mhartl/first_app.git 这种方法添加的 Github 仓库就是要输入用户名密码是吗?

用 https 就要用戶名和密碼,跟怎麼添加沒有關系,上面的命令是用來修改你之前添加的地址的。

其实就是 .git/config 里改 url ...

#5 楼 @luikore 确实,在这个文件里可以清楚看到所有的信息

You need to Sign in before reply, if you don't have an account, please Sign up first.