扫码关注官方订阅号
初学git 有点疑惑当我输入 git pull 的时候是需要密码的。而且这个密码我用登录密码,老是提示错误。如果我指定远程仓库就不要密码
应该是你在配置SSH key的时候 添加了密码吧
改成公钥认证吧,不用每次输密码
你如果配置了ssh而不生效,是不是你在git上有多个账号?那试试这个方法:
$ cd ~/.ssh
vi config
Host gitosc1 HostName oschina.net User git IdentityFile ~/.ssh/id_rsa
Host gitosc2 HostName oschina.net User git IdentityFile ~/.ssh/id_rsa2
修改远程地址
$ git remote add origin git@gitosc1:user1/project1.git$ git remote add origin git@gitosc2:user2/project2.git
我觉得是你在 remote 端设置了 SSH 吧?是这样吗?
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
应该是你在配置SSH key的时候 添加了密码吧
改成公钥认证吧,不用每次输密码
你如果配置了ssh而不生效,是不是你在git上有多个账号?那试试这个方法:
$ cd ~/.ssh
vi config
Host gitosc1
HostName oschina.net
User git
IdentityFile ~/.ssh/id_rsa
Host gitosc2
HostName oschina.net
User git
IdentityFile ~/.ssh/id_rsa2
修改远程地址
$ git remote add origin git@gitosc1:user1/project1.git
$ git remote add origin git@gitosc2:user2/project2.git
我觉得是你在 remote 端设置了 SSH 吧?
是这样吗?