Git and Bitbucket without SSH

▼魔方 西西 提交于 2019-12-03 05:36:40

问题


I've set up a local git repository on my computer, and I'm trying to push that to a newly created Bitbucket account.

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.

Is there a way to push to bitbucket without using ssh?


回答1:


You can connect to GitHub and Bitbucket repositories via HTTPS. Both will also let you push.

These are the typical URLs for HTTPS access:

https://username@bitbucket.org/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.




回答2:


I wanted to add that SourceTree somehow wants it without the username:

https://bitbucket.org/username/repository.git



回答3:


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.

Btw your slashes are wrong, it's ssh:// and https://




回答4:


Have you tried using?

git@bitbucket.org:accountname/reponame.git

You may take a look here



来源:https://stackoverflow.com/questions/16608086/git-and-bitbucket-without-ssh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!