How to trace git connections?

Issue

  • Our git connections are failing but the error does not give enough information
  • We need to see the process to connect to our git server

Environment

  • CloudBees Jenkins Enterprise - Managed Master (CJEMM)
  • CloudBees Jenkins Team (CJT)
  • CloudBees Jenkins Platform - Client Master (CJPCM)
  • DEV@cloud (D@C)
  • Git plugin

Resolution

Command line git debug output can be enabled with environment variables. They can be job parameters or agent environment variables, and will show more details of the ssh/http/https operations performed by git.

These environment variables will enable the verbose output of git.

GIT_TRACE=1
GIT_TRACE_PERFORMANCE=1
GIT_CURL_VERBOSE=1
GIT_SSH_COMMAND="ssh -vvv"

In some cases you may want to temporarily disable the verification of SSL certificates. We recommend that you do not disable SSL certificate verification permanently. Without SSL certificate verification, your git client is vulnerable to “man in the middle” attacks. Command line git ssl verification can be disabled by the environment variable:

GIT_SSL_NO_VERIFY=1

git documentation

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.