Error: "Fatal: I Don't Handle Protocol ''Git' When Using Bundle Install

error: fatal: I don't handle protocol ``git` when using bundle install

It's the issue with the newer version of the Bundler 1.0.14.

I needed to revert to 1.0.13 to make it work. They apparently had some issues dealing with escape characters in Windows.

See here > https://github.com/carlhuda/bundler/issues/1212

git: I don't handle protocol '[https'

I finally found a way to make it work :

git: convert "git" urls to "http" urls

Here's an example of rewriting the default protocol for GitHub:
git config --global url.https://github.com/.insteadOf git://github.com/

Git fatal: protocol 'https' is not supported

Problem is probably this.

You tried to paste it using

  • CTRL + V

before and it didn't work so you went ahead and pasted it with classic

  • Right Click - Paste**.

Sadly whenever you enter CTRL + V on terminal it adds

  • a hidden ^?

(at least on my machine it encoded like that).

the character that you only appears after you

  • backspace

(go ahead an try it on git bash).

So your link becomes ^?https://...

which is invalid.

New Ruby on Rails developer needs help setting up a development environment

Try the solution here, error: "fatal: I don't handle protocol ``git` when using bundle install

If you don't need will_paginate's repo head you can always change

gem 'will_paginate', :git => "git://github.com/mislav/will_paginate.git"

To just

gem 'will_paginate'

git:// protocol blocked by company, how can I get around that?

If this is an issue with your firewall blocking the git: protocol port (9418), then you should make a more persistent change so you don't have to remember to issue commands suggested by other posts for every git repo.

The below solution also just works for submodules which might also be using the git: protocol.

Since the git message doesn't really point immediately to the firewall blocking port 9418, lets try to diagnose this as the actual problem.

Diagnosing the Problem

References: https://superuser.com/q/621870/203918 and https://unix.stackexchange.com/q/11756/57414

There are several tools we can use to determine if the firewall causing our problem - use whichever is installed on your system.

# Using nmap
# A state of "filtered" against port 9418 (git) means
# that traffic is being filtered by a firewall
$ nmap github.com -p http,git

Starting Nmap 5.21 ( http://nmap.org ) at 2015-01-21 10:55 ACDT
Nmap scan report for github.com (192.30.252.131)
Host is up (0.24s latency).
PORT STATE SERVICE
80/tcp open http
9418/tcp filtered git

# Using Netcat:
# Returns 0 if the git protocol port IS NOT blocked
# Returns 1 if the git protocol port IS blocked
$ nc github.com 9418 < /dev/null; echo $?
1

# Using CURL
# Returns an exit code of (7) if the git protocol port IS blocked
# Returns no output if the git protocol port IS NOT blocked
$ curl http://github.com:9418
curl: (7) couldn't connect to host

OK, so now we have determined it is our git port being blocked by a firewall, what can we do about it? Read on :)

Basic URL Rewriting

Git provides a way to rewrite URLs using git config. Simply issue the following command:

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

Now, as if by magic, all git commands will perform a substitution of git:// to https://

What Changes Did This Command Make?

Take a look at your global configuration using:

git config --list

You'll see the following line in the output:

url.https://.insteadof=git://

You can see how this looks on file, by taking a peek at ~/.gitconfig where you should now see that the following two lines have been added:

[url "https://"]
insteadOf = git://

Want More Control?

Simply use a more complete/specific URL in the replacement. For example, to only have GitHub URLs use https:// instead of git://, you could use something like:

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

You can run this command multiple times using different replacements. However, in the event that a URL matches multiple replacements, the longest match "wins". Only a single replacement will be made per URL.

System-Wide Changes for Sysadmins

If you're a Linux Sysadmin and you don't want your users to have to go through the above pains you can make a quick system-wide git configuration change.

Simply edit or add the following contents to /etc/gitconfig and voila your users don't have to worry about any of the above:

[url "https://"]
insteadOf = git://

git: fatal: Could not read from remote repository

You can specify the username that SSH should send to the remote system as part of your remote's URL. Put the username, followed by an @, before the remote hostname.

git remote set-url website abc@***.com:path/to/repo

How can I make git accept a self signed certificate?

To permanently accept a specific certificate

Try http.sslCAPath or http.sslCAInfo. Adam Spiers's answer gives some great examples. This is the most secure solution to the question.

To disable TLS/SSL verification for a single git command

try passing -c to git with the proper config variable, or use Flow's answer:

git -c http.sslVerify=false clone https://example.com/path/to/git

To disable SSL verification for all repositories

It is possible to globally deactivate ssl verification. It is highly recommended to NOT do this but it is mentioned for completeness:

git config --global http.sslVerify false # Do NOT do this!

There are quite a few SSL configuration options in git. From the man page of git config:

http.sslVerify
Whether to verify the SSL certificate when fetching or pushing over HTTPS.
Can be overridden by the GIT_SSL_NO_VERIFY environment variable.

http.sslCAInfo
File containing the certificates to verify the peer with when fetching or pushing
over HTTPS. Can be overridden by the GIT_SSL_CAINFO environment variable.

http.sslCAPath
Path containing files with the CA certificates to verify the peer with when
fetching or pushing over HTTPS.
Can be overridden by the GIT_SSL_CAPATH environment variable.

A few other useful SSL configuration options:

http.sslCert
File containing the SSL certificate when fetching or pushing over HTTPS.
Can be overridden by the GIT_SSL_CERT environment variable.

http.sslKey
File containing the SSL private key when fetching or pushing over HTTPS.
Can be overridden by the GIT_SSL_KEY environment variable.

http.sslCertPasswordProtected
Enable git's password prompt for the SSL certificate. Otherwise OpenSSL will
prompt the user, possibly many times, if the certificate or private key is encrypted.
Can be overridden by the GIT_SSL_CERT_PASSWORD_PROTECTED environment variable.

Pushing to Git returning Error Code 403 fatal: HTTP request failed

I just got the same problem and just figured out what's cause.

Github seems only supports ssh way to read&write the repo, although https way also displayed 'Read&Write'.

So you need to change your repo config on your PC to ssh way:

  1. Edit .git/config file under your repo directory.
  2. Find url=entry under section [remote "origin"].
  3. Change it from:

    url=https://MichaelDrogalis@github.com/derekerdmann/lunch_call.git

    to:

    url=ssh://git@github.com/derekerdmann/lunch_call.git

    That is, change all the texts before @ symbol to ssh://git
  4. Save config file and quit. now you could use git push origin master to sync your repo on GitHub.


Related Topics



Leave a reply



Submit