无法让 git 上的 Http 工作 [英] Cannot get Http on git to work

查看:10
本文介绍了无法让 git 上的 Http 工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在拇指驱动器上使用 gitbash 进行 git.我有防火墙阻止我,想设置我的 git 以进行 http 访问.我使用 github,并且我已经看到了有关如何执行此操作的各种信息,但我对它的理解不足以使其为我自己工作.我在 php.ini 文件中启用了 curl,这已经是我所能完成的了.在您尝试帮助我之前,请了解我不是命令行专家,因此请详细说明任何命令行说明,就好像这是我第一次使用一样(我使用 consolePortable BTW).也让我知道我应该在哪里运行任何建议的命令的根"或特定文件夹.我在拇指驱动器上使用 xampp,所以如果有卷曲路径或任何我必须设置的东西,请让我知道我应该在哪里找到它,而不是例如..我不是想变得困难,我只是想把这个设置好.

谢谢.

解决方案

如果你的防火墙允许 https,你可以使用你的 GitHub repo 的基于 https 的地址来推/拉.

你需要:

  • 在您的 gitbash 会话中定义 http_proxyhttps_proxy 环境变量(到正确的代理,使用您的 Internet 登录名和密码):
    export https_proxy=http://<login_internet>:<password_internet>@aproxy:aport
  • 定义你的 git 将在哪里寻找 CA:
    git config --system http.sslcainfo/bin/curl-ca-bundle.crt
  • 确保您定义了一个 HOME 环境变量(到您想要的任何目录)
  • %HOME% 中有一个 _netrc 文件(注意_"),其中包含:
<上一页>机器github.com登录 YourGitHubLogin密码 YourGitHubPassword

从那里,你所有的 git pull/git push 从和到 GitHub 存储库都可以工作!

I am using gitbash for git on my thumbdrive. I have a firewall blocking me and would like to set up my git for http access. I use github and I have seen all kinds of infomation on how to do so but I do not understand enough to make it work for my self. I have curl enabled in the php.ini file and that is about as far as I have been able to get done. Before you attempt to assist me please understand that I am not a command line guru so with any command line instructions please be detailed as if it is my first time using one (I use consolePortable BTW). Also let me know where exactly I should be as far as the "root" or a specific folder to run any suggested commands. I use xampp on my thumbdrive so if there is a path to curl or any thing that I have to set please let me know where I should find it and not eg. . I am not trying to be difficult I just want to get this set up.

Thank you.

解决方案

If your firewall allows https, you can use the https-based address of your GitHub repo to push/pull.

You need:

  • to define in your gitbash session http_proxy and https_proxy environment variable (to the right proxy, with your internet login and password):
    export https_proxy=http://<login_internet>:<password_internet>@aproxy:aport
  • to define where your git will look for the CAs:
    git config --system http.sslcainfo /bin/curl-ca-bundle.crt
  • to make sure you have a HOME environment variable defined (to any directory you want)
  • to have in %HOME% a _netrc file (note the '_') with in it:

machine github.com
login YourGitHubLogin
password YourGitHubPassword

From there, all your git pull/git push from and to GitHub repo will work!

这篇关于无法让 git 上的 Http 工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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