Skip to main content
Enterprise Agile Planning Image

This post is from the CollabNet VersionOne blog and has not been updated since the original publish date.

Last Updated Mar 14, 2013 — Enterprise Agile Planning expert

Tips on Git

Enterprise Agile Planning

I recently had to debug an issue where the Git client refused to connect to an http url to fetch content, but worked well on the https url. I was curious to find out what was happening under the hood. It turned out that the http end point was configured to redirect to https url and the Git client (1.7.1) that was under test failed to honor the redirect request. I had googled to find out about GIT_CURL_VERBOSE and decided to search the Git source for more of these. I am sharing here few tips to debug and fix http(s) related issues in Git client (Git for linux/msysgit for windows), which I feel can be useful in debugging or fixing remote http(s) helper.

GIT_CURL_VERBOSE – Set this environmental variable to a Boolean value to debug the curl transaction while accessing the repository via http(s) remote helper
Example
GIT_CURL_VERBOSE=1 git ls-remote https://github.com/git/git.git
Use Case(s)
-Troubleshooting curl related issues

GIT_SSL_NO_VERIFY – Set this environmental variable to a Boolean value to disable the SSL certificate verification while accessing the repository via https remote helper
Example
GIT_SSL_NO_VERIFY=1 git ls-remote https://207.97.227.239/git/git.git
(github.com resolved to 207.97.227.239 on 13/03/2013)
Use Case(s)
-Self Signed SSL Certificates.
-Internal CA certificate in an corporate environment

GIT_HTTP_LOW_SPEED_LIMIT – Set this environmental variable to a value greater than zero, representing the download speed in bytes per second.
GIT_HTTP_LOW_SPEED_TIME – Set this environmental variable to a value greater than zero, representing the time in seconds.

When these two environmental variables are set to values more than zero, the git remote operations over http(s) remote helper will terminate if the download speed maintains at or below
GIT_HTTP_LOW_SPEED_LIMIT bytes per second for GIT_HTTP_LOW_SPEED_LIMIT second(s)
Example
GIT_HTTP_LOW_SPEED_LIMIT=2000 GIT_HTTP_LOW_SPEED_TIME=5 git clone
https://github.com/git/git.git

(To simulate the network speed one can use trickle on linux)
Use Case(s)
-To include in scripts that should not be locked for a long duration because of a slow network connectivity.

GIT_HTTP_USER_AGENT – Set this environmental variable to the string that would be presented to the server as the User-Agent string, when accessing the repository via http(s) remote helper
Example
GIT_HTTP_USER_AGENT=CustomAgent/1.0 GIT_CURL_VERBOSE=1 git ls-remote https://github.com/git/git.git
Use Case(s)
-If there are proxies that limits the internet connectivity based on the User-Agent string, this environmental variable can be set to a browser User-Agent string that is accepted by the proxy.

For more information on Git, please visit http://visit.collab.net/gotgit.html (Tweet This!) or you may contact CollabNet.

More from the Blog

View more
Feb 14, 2021

Reflecting on the 20th anniversary of the Agile Manifesto

Enterprise Agile Planning
Over the past 20 years, it’s been amazing to watch an idea from ...
Read More
Feb 08, 2021

How does agile apply to an entire organization?

Enterprise Agile Planning
Before we dive into the main subject of this blog post, it is importan ...
Read More
Feb 03, 2021

It took a pandemic to realize why digital transformation actually matters

Enterprise Agile Planning
Before anyone had ever heard of COVID-19, businesses across the globe ...
Read More
Jan 27, 2021

Improve visibility, reduce costs, and take back control of your scaled out container and cloud deployments with the latest releases of Digital.ai Agility and DevOps solutions

Enterprise Agile Planning
We’re thrilled to announce the latest releases of our Digital.ai Agili ...
Read More
Contact Us