在没有SSH访问的防火墙后面使用GitHub [英] Using GitHub behind a firewall without SSH access

查看:190
本文介绍了在没有SSH访问的防火墙后面使用GitHub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的想使用GitHub,但是我的公司已经锁定了一切。现在,我只能通过HTTP协议使用Tortoise SVN。我可以用同样的方式使用GitHub吗?如果是这样,怎么样?

解决方案

我想你一直都能克隆 -smart-http-support> https://github.com/blog/642-smart-http-support


给出一个简短的总结 - 如果你点击一个仓库的Source选项卡上的HTTP按钮,它会给你一个URL:


https://mhl@github.com/mhl/unicode-poster.git


如果您使用该网址进行克隆,每当您需要与服务器通信时,它都会提示您输入github密码(例如, git clone git fetch git push 等)但是,您也可以使用以下URL进行克隆:


https://mhl:notactuallymypassword@github.com/mhl/unicode-poster.git


...并且您不需要重新输入密码。 (正如那篇博客文章中提到的,确保你在URL的开头有 https:// ,并且要知道这意味着你的github密码将被存储在你的git配置明文中,所以不要让任何人拷贝你的 .git 目录!)


I really want to use GitHub, but my company has everything locked down. Now, I can only use Tortoise SVN through the HTTP protocol. Can I use GitHub the same way? If so, how?

解决方案

I think you've always been able to clone github repositories over HTTP, but with the restriction that you couldn't push back to them. However, github have recently introduced the Smart HTTP transport, so now you can also push over HTTPS. This should work fine from behind any firewall. There's more on the Smart HTTP support in this blog post:

https://github.com/blog/642-smart-http-support

To give a short summary - if you click the HTTP button on the "Source" tab of a repository, it'll give you a URL like:

https://mhl@github.com/mhl/unicode-poster.git

If you clone with that URL, it'll prompt you for your github password whenever you need to communicate with the server (e.g. with git clone, git fetch, git push, etc.) However, you can also clone using a URL like:

https://mhl:notactuallymypassword@github.com/mhl/unicode-poster.git

... and you won't need to re-enter your password. (As that blog post mentions, make sure you've got https:// at the start of the URL, and be aware that this means that your github password will be stored in plaintext in your git config, so don't let anyone copy your .git directory!)

这篇关于在没有SSH访问的防火墙后面使用GitHub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆