没有 SSH 的 Git 和 Bitbucket
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16608086/
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
Git and Bitbucket without SSH
提问by Kitchi
I've set up a local git repository on my computer, and I'm trying to push that to a newly created Bitbucket account.
我已经在我的计算机上设置了一个本地 git 存储库,我正在尝试将它推送到一个新创建的 Bitbucket 帐户。
The problem is that Bitbucket gives me an ssh
url to push to, but the network I'm on (university) has the ssh port blocked for external ssh. So that fails, and if I try to replace ssh://
with https://
it keeps telling me that authentication has failed.
问题是 Bitbucket 给了我一个ssh
要推送到的url,但是我所在的网络(大学)的 ssh 端口被外部 ssh 阻止。所以失败了,如果我尝试ssh://
用https://
它替换它,它会不断告诉我身份验证失败。
Is there a way to push to bitbucket without using ssh
?
有没有办法在不使用的情况下推送到 bitbucket ssh
?
回答by poke
You can connect to GitHub and Bitbucket repositories via HTTPS. Both will also let you push.
您可以通过 HTTPS 连接到 GitHub 和 Bitbucket 存储库。两者也会让你推动。
These are the typical URLs for HTTPS access:
这些是用于 HTTPS 访问的典型 URL:
https://[email protected]/username/repository.git
https://github.com/username/repository.git
Note that Git will prompt you for your password whenever you want to communicate with the remote.
请注意,每当您想与远程通信时,Git 都会提示您输入密码。
回答by Largo
I wanted to add that SourceTree somehow wants it without the username:
我想添加 SourceTree 以某种方式想要它没有用户名:
https://bitbucket.org/username/repository.git
回答by 1615903
Https addresses on GitHub are read-only. As far as I know, SSH is your only option if you need write access.See poke's answer.
GitHub 上的 Https 地址是只读的。据我所知,如果您需要写访问权限,SSH 是您唯一的选择。参见poke 的回答。
Btw your slashes are wrong, it's ssh://
and https://
顺便说一下你的斜杠是错误的,这是ssh://
和https://
回答by gpicchiarelli
Have you tried using?
你试过使用吗?
[email protected]:accountname/reponame.git
You may take a look here
你可以看看这里