git 如何在 GitBash 中禁用 SSH 并改用 HTTPS
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15192485/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to disable SSH in GitBash and use HTTPS instead
提问by lincx
I'm using SSH at the moment when connecting to Bitbucket and suddenly the port 22 where Bitbucket uses has been blocked so I decided to use HTTPS option instead. How to disable the ssh in git bash and use HTTPS instead? I already reinstalled git but it still it uses SSH/Putty to connect.
我在连接到 Bitbucket 时正在使用 SSH,突然 Bitbucket 使用的端口 22 已被阻止,因此我决定改用 HTTPS 选项。如何在 git bash 中禁用 ssh 并改用 HTTPS?我已经重新安装了 git,但它仍然使用 SSH/Putty 进行连接。
Thanks.
谢谢。
回答by CharlesB
It's not at git settings, but in your repository settings.
它不在 git 设置中,而是在您的存储库设置中。
You need to change the address of your remote repository and specify the https://
protocol
您需要更改远程存储库的地址并指定https://
协议
git remote set-url origin <repo-https-url>
However with https you'll have to type your password on each push/pull operation, but see Is there a way to skip password typing when using https:// on GitHub?.
但是,使用 https 时,您必须在每次推/拉操作时输入密码,但请参阅在 GitHub 上使用 https:// 时是否可以跳过密码输入?.