E2E test of repository cleanup
Feature doc: https://docs.gitlab.com/ee/user/project/repository/reducing_the_repo_size_using_git.html#repository-cleanup
Steps
- Create a project.
- Push files that will be removed.
- Run
git filter-repo --path files/to/remove --invert-paths
- Force push to remove the files.
- Go to Settings > Repository.
- Upload
.git/filter-repo/commit-map
. - Click Start cleanup.
- Run
git gc --prune=now
in the GitLab/Gitaly container. - Clear the cache: https://docs.gitlab.com/ee/administration/raketasks/maintenance.html#clear-redis-cache
- Confirm the files are gone from GitLab's history.
Also consider adding a test for automatic pruning within 24 hours: gitlab-org/gitlab#220104 (closed)
Edited by Mark Lapierre