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.
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:
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:
That writes the setting into .git/config, so it affects only that repository:
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:
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:
Then create ~/.gitconfig-internal-noverify:
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:
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:
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_VERIFYis 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
includeIfwith 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
- How do I un-expose undo expose service?
- How do I update the password for Git?
- How do I use Amazon Cognito as user authentication for my website NOT mobile app
- How do I use basic HTTP authentication with the Python Requests library?
- How do I set up a Kafka service on gitlab-ci.yml?
- How do I show my global Git configuration?
- How do I use the Argon2 algorithm with password_hash?
- How do I use WebRequest to access an SSL encrypted site using HTTPS?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack 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.