How to remove a repository from Sourcegraph
Prerequisites
This document assumes that you have:
- site-admin level permissions on your Sourcegraph instance
- access to your Sourcegraph deployment
Steps to remove a repository from Sourcegraph
Open the repository's Settings
page on Sourcegraph and from the Options
tab click Exclude repository
to exclude it from the specific code host.
Alternately, if a repository is synced from multiple code host connections you may exclude it from all code hosts by clicking the Exclude repository from all code hosts
button instead.
Remove corrupted repository data from Sourcegraph
- Exclude the repository as shown above from your code host(s)
- Wait for the repository to disappear from the Repository Status Page located in your Site Admin panel.
- Once you have confirmed the previous step has been completed, you will then exec into Gitserver (for docker-compose and kubernetes deployments) to locate the files that are associated with the repository.
- Look for a directory with the name of the repository in the Gitserver. It should be located in the following file path:
data/repos/{name-of-code-host}/{name-of-repository}
- Delete the directory for that repository from the previous step.
To reclone a removed repository
Open the repository's Settings
page on Sourcegraph and from the Mirroring
tab click Reclone
.