Custom git config

Sourcegraph supports customising git-config and ssh_config for adjusting the behaviour of git. Sourcegraph will read these from the standard locations.

This guide documents how to configure git-config. To set up SSH and authentication for repositories, see Repository authentication.

Example: alternate clone URL for repos

Some sites put an HTTPS or SSH proxy in front of their code host to reduce load. Some sites also use a service like AWS CodeCommit to do the same. In these cases, the repos still should be treated as being repos on the original code host, not the proxy site.

For example, I have a GitHub repo I want Sourcegraph to clone it using the URL But I still want the "Go to GitHub repository" button, etc., to take me to You can use the git configuration insteadOf:

# ~/.gitconfig or /etc/gitconfig
[url ""]
  insteadOf =

If you are cloning via SSH, you can also achieve this with an SSH configuration:

# ~/.ssh/config