문제

참고 : 설명 된 유스 케이스는 프로젝트 내에서 하위 모듈을 사용하는 것이지만, 이는 정상에도 동일하게 적용됩니다. git clone HTTP에 대한 저장소의.

Git Control에 프로젝트가 있습니다. 하위 모듈을 추가하고 싶습니다 :

git submodule add http://github.com/jscruggs/metric_fu.git vendor/plugins/metric_fu

그러나 나는 얻는다

...
got 1b0313f016d98e556396c91d08127c59722762d0
got 4c42d44a9221209293e5f3eb7e662a1571b09421
got b0d6414e3ca5c2fb4b95b7712c7edbf7d2becac7
error: Unable to find abc07fcf79aebed56497e3894c6c3c06046f913a under http://github.com/jscruggs/metri...
Cannot obtain needed commit abc07fcf79aebed56497e3894c6c3c06046f913a
while processing commit ee576543b3a0820cc966cc10cc41e6ffb3415658.
fatal: Fetch failed.
Clone of 'http://github.com/jscruggs/metric_fu.git' into submodule path 'vendor/plugins/metric_fu'

http_proxy를 설정했습니다.

c:\project> echo %HTTP_PROXY%
http://proxy.mycompany:80

HTTP 프록시에 대한 글로벌 GIT 설정도 있습니다.

c:\project> git config --get http.proxy
http://proxy.mycompany:80

대리를 통해 일관되게 작업하기 위해 HTTP 가져온 사람이 있습니까? 정말 이상한 점은 Github의 몇 가지 프로젝트가 잘 작동한다는 것입니다.awesome_nested_set 예를 들어), 그러나 다른 사람들은 일관되게 실패합니다 (울타리 예를 들어).

도움이 되었습니까?

해결책 3

마침내 일한 것은 http_proxy 환경 변수. 나는 설정했다 HTTP_PROXY 올바르게하지만 Git은 분명히 소문자 버전을 더 좋아합니다.

다른 팁

GIT가 글로벌 구성 속성에서 사용하는 HTTP 프록시를 설정할 수도 있습니다. http.proxy:

git config --global http.proxy http://proxy.mycompany:80

프록시로 인증하려면 :

git config --global http.proxy http://mydomain\\myusername:mypassword@myproxyserver:8080/

(신용은 간다 @eugenekulabuhov 그리고 @jaimereynoso 인증 형식의 경우)

이미 이것에 대한 훌륭한 대답이 있습니다. 그러나 일부 프록시 서버에서 사용자 ID 및 비밀번호로 인증해야하므로 칩을 섭취 할 것이라고 생각했습니다. 때때로 이것은 도메인에있을 수 있습니다.

예를 들어 프록시 서버 구성이 다음과 같습니다.

Server: myproxyserver
Port: 8080
Username: mydomain\myusername
Password: mypassword

그런 다음 추가하십시오 .gitconfig 다음 명령을 사용하여 파일 :

git config --global http.proxy http://mydomain\\myusername:mypassword@myproxyserver:8080

걱정하지 마십시오 https. 지정된 프록시 서버가 HTTP 및 HTTPS를 지원하는 한 구성 파일의 한 항목으로 충분합니다.

그런 다음 명령이 귀하의 항목을 추가했는지 확인할 수 있습니다. .gitconfig 수행하여 성공적으로 파일 cat .gitconfig:

파일 끝에는 다음과 같이 항목이 표시됩니다.

[http]
    proxy = http://mydomain\\myusername:mypassword@myproxyserver:8080

그게 다야!

Windows에서 Mingw 컴파일을 사용하는 것 같습니다 (또는 내가 듣지 못한 다른 것). 이것을 디버깅하는 방법이 있습니다. GIT 용 HTTP 프록시 작업은 Curl에 의해 수행된다고 생각합니다. GIT를 실행하기 전에이 환경 변수를 설정하십시오.

GIT_CURL_VERBOSE=1

이것은 적어도 무대 뒤에서 무슨 일이 일어나고 있는지에 대한 아이디어를 제공해야합니다.

지정된 저장소에서 프록시를 사용하려면 다른 저장소가 필요하지 않습니다. 바람직한 방법은 -c, --config <key=value> 당신이 옵션 git clone 저장소. 예를 들어

$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git --config "http.proxy=proxyHost:proxyPort"

네트워크 팀이 인증서를 다시 작성하여 SSL-Inspection을 수행 한 다음 HTTPS 대신 HTTP URL을 사용 하여이 VAR을 설정하는 것과 결합했습니다.

git config --global http.proxy http://proxy:8081

당신도 할 수 있습니다 .gitconfig 파일을 편집합니다 Windows 시스템의 % userProfile % 디렉토리에 위치메모장 %userprofile %.gitconfig) 또는 Linux 시스템의 ~ 디렉토리 (vi ~/.gitconfig) 그리고 HTTP 섹션을 추가하십시오 아래.

.gitConfig 파일의 내용 :

[http]
        proxy = http://proxy.mycompany:80

이것은 오래된 질문이지만 Windows에있는 경우 HTTPS URL을 통해 검색하는 경우 HTTPS_PROXY를 설정하는 것을 고려하십시오. 나를 위해 일했습니다!

나에게 git : // https : //하지만 프록시를 통해 작동하지 않습니다. 이로 인해 모든 git을 사용하는 스크립트를 실행하고 있었기 때문에 약간의 두통이 발생했습니다. 그러나 나는이 보석을 발견했다

git config --global url."https://github.com/".insteadOf git://github.com/

나도 찾지 못했습니다 http.proxy ...도 아니다 GIT_PROXY_COMMAND 인증 된 HTTP 프록시를 위해 작업하십시오. 프록시는 어느 쪽이든 트리거되지 않습니다. 그러나 나는 이것을 해결하는 방법을 찾습니다.

  1. 설치 빙빙 돌리다, 또는 원하는 다른 대안.
  2. Authfile을 만듭니다. 형식 authfile 이다: user_name:password, 그리고 user_name, password 프록시에 액세스하기위한 사용자 이름과 비밀번호입니다. 그러한 파일을 만들려면 다음과 같은 명령을 실행하십시오. echo "username:password" > ~/.ssh/authfile.

  3. 편집하다 ~/.ssh/config, 그리고 허가가 있는지 확인하십시오 644: chmod 644 ~/.ssh/config

github.com을 예로 들어, 다음 줄을 추가하십시오. ~/.ssh/config:

Host    github.com
        HostName        github.com
        ProxyCommand    /usr/local/bin/corkscrew <your.proxy> <proxy port> %h %p <path/to/authfile>
        User            git

이제 당신은 무엇이든 할 때마다 git@github.com, 프록시를 자동으로 사용합니다. 당신은 쉽게 똑같은 일을 할 수 있습니다 비트 버킷 또한.

이것은 다른 접근 방식만큼 우아하지는 않지만 매력처럼 작동합니다.

Windows에서는 비밀번호를 일반 텍스트로 gitconfig에 넣고 싶지 않다면 사용할 수 있습니다.

그것은 당신을 정상 또는 Windows NTLM 프록시로부터 평가하고 인증없이 LocalHost-Proxy를 시작합니다.

실행하기 위해 :

  • CNTML을 설치하십시오
  • 프록시 인증을 전달하기 위해 문서에 따라 CNTML을 구성하십시오.
  • 새로운 LocalHost 프록시에 대한 포인트 git :

    [http]
        proxy = http://localhost:3128       # change port as necessary
    

For me what it worked was:

sudo apt-get install socat

Create a file inside your $BIN_PATH/gitproxy with:

#!/bin/sh 
_proxy=192.168.192.1 
_proxyport=3128 
exec socat STDIO PROXY:$_proxy:$1:$2,proxyport=$_proxyport

Dont forget to give it execution permissions

chmod a+x gitproxy

Run following commands to setup environment:

export PATH=$BIN_PATH:$PATH
git config --global core.gitproxy gitproxy

Just to post this as it is the first result on Google, this blog post I found solves the problem for me by updated the curl certificates.

http://www.simplicidade.org/notes/archives/2011/06/github_ssl_ca_errors.html

Setup proxy to git

command

git config --global http.proxy http://user:password@domain:port

example

git config --global http.proxy http://clairton:123456@proxy.clairtonluz.com.br:8080

This worked to me.

git config --global http.proxy proxy_user:proxy_passwd@proxy_ip:proxy_port

I had the same problem, with a slightly different fix: REBUILDING GIT WITH HTTP SUPPORT

The git: protocol did not work through my corporate firewall.

For example, this timed out:

git clone git://github.com/miksago/node-websocket-server.git

curl github.com works just fine, though, so I know my http_proxy environment variable is correct.

I tried using http, like below, but got an immediate error.

git clone http://github.com/miksago/node-websocket-server.git

->>>  fatal: Unable to find remote helper for 'http' <<<-

I tried recompiling git like so:

./configure  --with-curl --with-expat

but still got the fatal error.

Finally, after several frustrating hours, I read the configure file, and saw this:

# Define CURLDIR=/foo/bar if your curl header and library files are in

# /foo/bar/include and /foo/bar/lib directories.

I remembered then, that I had not complied curl from source, and so went looking for the header files. Sure enough, they were not installed. That was the problem. Make did not complain about the missing header files. So I did not realize that the --with-curl option did nothing (it is, in fact the default in my version of git).

I did the following to fix it:

  1. Added the headers needed for make:

    yum install curl-devel
    (expat-devel-1.95.8-8.3.el5_5.3.i386  was already installed).
    
  2. Removed git from /usr/local (as I want the new install to live there).

    I simply removed git* from /usr/local/share and /usr/local/libexec

  3. Searched for the include dirs containing the curl and expat header files, and then (because I had read through configure) added these to the environment like so:

    export CURLDIR=/usr/include 
    export EXPATDIR=/usr/include
    
  4. Ran configure with the following options, which, again, were described in the configure file itself, and were also the defaults but what the heck:

    ./configure  --with-curl --with-expat
    
  5. And now http works with git through my corporate firewall:

    git clone http://github.com/miksago/node-websocket-server.git
    Cloning into 'node-websocket-server'...
    * Couldn't find host github.com in the .netrc file, using defaults
    * About to connect() to proxy proxy.entp.attws.com port 8080
    *   Trying 135.214.40.30... * connected
    ...
    

you can use:

git config --add http.proxy http://user:password@proxy_host:proxy_port

Set Git credential.helper to wincred.

git config --global credential.helper wincred

Make sure there is only 1 credential.helper

git config -l

If there is more than 1 and it's not set to wincred remove it.

git config --system --unset credential.helper

Now set the proxy with no password.

git config --global http.proxy http://<YOUR WIN LOGIN NAME>@proxy:80

Check that all the settings that you added looks good....

git config --global -l

Now you good to go!

This isn't a problem with your proxy. It's a problem with github (or git). It fails for me on git-1.6.0.1 on linux as well. Bug is already reported (by you no less).

Make sure to delete your pasties, they're already on google. Edit: Must've been dreaming, i guess you can't delete them. Use Gist instead?

$http_proxy is for http://github.com.... $https_proxy is for https://github.com...

For Windows

Goto --> C:/Users/user_name/gitconfig

Update gitconfig file with below details

[http]

[https]

proxy = https://your_proxy:your_port

[http]

proxy = http://your_proxy:your_port

How to check your proxy and port number?

Internet Explorer -> Settings -> Internet Options -> Connections -> LAN Settings

Use proxychains

proxychains git pull ...

update: proxychains is discontinued, use proxychains-ng instead.

I got around the proxy using https... some proxies don't even check https.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

c:\git\meantest>git clone http://github.com/linnovate/mean.git
Cloning into 'mean'...
fatal: unable to access 'http://github.com/linnovate/mean.git/': Failed connect
to github.com:80; No error

c:\git\meantest>git clone https://github.com/linnovate/mean.git
Cloning into 'mean'...
remote: Reusing existing pack: 2587, done.
remote: Counting objects: 27, done.
remote: Compressing objects: 100% (24/24), done.
rRemote: Total 2614 (delta 3), reused 4 (delta 0)eceiving objects:  98% (2562/26

Receiving objects: 100% (2614/2614), 1.76 MiB | 305.00 KiB/s, done.
Resolving deltas: 100% (1166/1166), done.
Checking connectivity... done

The above answers worked for me when my proxy doesn't need authentication. If you are using proxy which requires you to authenticate then you may try CCProxy. I have small tutorial on how to set it up here,

http://blog.praveenkumar.co.in/2012/09/proxy-free-windows-xp78-and-mobiles.html

I was able to push, pull, create new repos. Everything worked just fine. Make sure you do a clean uninstall and reinstall of new version if you are facing issues with Git like I did.

As this was answered by many but This is just for Winodws USER who is behind proxy with auth.

Re-Installing(first failed, Don't remove).

Goto ->
**Windows**
1. msysgit\installer-tmp\etc\gitconfig
    Under [http]
        proxy = http://user:pass@url:port

**Linux**
1. msysgit\installer-tmp\setup-msysgit.sh
      export HTTP_PROXY="http://USER:PASS@proxy.abc.com:8080"

if you have any special char in user/pass use url_encode

as @user2188765 has already pointed out, try replacing the git:// protocol of the repository with http[s]://. See also this answer

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top