Git
SSL
Configuration
Repository
Security

How do I set GIT_SSL_NO_VERIFY for specific repos only?

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

GIT_SSL_NO_VERIFY is an environment variable, so by itself it applies to the Git process you launch, not permanently to one repository. If you want the "disable certificate verification" behavior only for selected repositories, use repository-local Git config or a conditional include instead of setting the environment variable globally.

The Safer Answer: Fix the Certificate Problem

Before showing the configuration, it is worth stating the obvious security point: disabling SSL verification means Git stops checking whether the server certificate is trustworthy. That opens the door to man-in-the-middle attacks.

If the repository is internal and uses a private certificate authority, the better fix is to trust that CA explicitly:

bash
git config --global http.sslCAInfo /path/to/internal-ca.pem

Use sslVerify = false only when you understand the risk and cannot fix the certificate chain properly.

Set It for One Repository with Local Config

Inside the target repository, set the local Git config value:

bash
cd /path/to/repo
git config --local http.sslVerify false

That writes the setting into .git/config, so it affects only that repository:

ini
[http]
    sslVerify = false

This is the closest equivalent to "only for this repo" and is usually the simplest solution.

Check What Git Will Use

To confirm the active value, inspect the origin of the setting:

bash
git config --show-origin --get http.sslVerify

If the result points at .git/config, you have successfully limited the scope to that repository.

Use a Conditional Include for Several Internal Repositories

If you have a group of repositories under one directory and want the same behavior for all of them, use includeIf in your global config.

In ~/.gitconfig:

ini
[includeIf "gitdir:/Users/markqian/work/internal/"]
    path = ~/.gitconfig-internal-noverify

Then create ~/.gitconfig-internal-noverify:

ini
[http]
    sslVerify = false

Now only repositories whose .git directory lives under that path will inherit the insecure setting.

A More Precise Host-Based Option

Sometimes the real need is not repo-specific, but host-specific. Git lets you scope HTTP configuration to a URL:

bash
git config --global http.https://git.internal.example.com.sslVerify false

This is broader than repository-local config but narrower than disabling verification for all HTTPS remotes. It can be useful when one internal Git server has the certificate problem and the rest do not.

Temporary One-Off Command

If you only need to bypass verification for a single command, keep the change out of config entirely:

bash
GIT_SSL_NO_VERIFY=true git clone https://git.internal.example.com/project.git

That applies only to that process invocation. It is not repo-local persistence, but it is often the right move for quick diagnosis.

Common Pitfalls

The biggest mistake is exporting GIT_SSL_NO_VERIFY=true in your shell profile. That silently disables certificate verification for every Git command you run, including unrelated public repositories.

Another issue is forgetting that local config follows the repository, not the remote host. If you clone the same internal server into a second directory, it will not inherit the first repository's local setting unless you configure it again.

Finally, do not use sslVerify = false as a long-term substitute for installing the correct root certificate. The insecure setting may solve the immediate friction, but it leaves the transport trust model broken.

Summary

  • 'GIT_SSL_NO_VERIFY is process-scoped, not a built-in repo-scoped setting.'
  • For one repository, use git config --local http.sslVerify false.
  • For a directory of repositories, use includeIf with a separate config file.
  • For one internal Git host, URL-scoped HTTP config can be more precise.
  • The preferred fix is still to trust the correct certificate authority instead of disabling verification.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design