From c19ddce43c5ff50bb507d3cbdccb7ebc84877e1e Mon Sep 17 00:00:00 2001 From: Justin Farmiloe Date: Wed, 7 Jun 2023 05:03:38 +0000 Subject: [PATCH 1/4] Add mirror details and cleanup warning --- .../reducing_the_repo_size_using_git.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/user/project/repository/reducing_the_repo_size_using_git.md b/doc/user/project/repository/reducing_the_repo_size_using_git.md index d519fda764f7b9..ecee96a6e35454 100644 --- a/doc/user/project/repository/reducing_the_repo_size_using_git.md +++ b/doc/user/project/repository/reducing_the_repo_size_using_git.md @@ -74,7 +74,7 @@ To purge files from a GitLab repository: 1. Clone a fresh copy of the repository from the bundle using `--bare` and `--mirror` options: ```shell - git clone --bare /path/to/project.bundle + git clone --bare --mirror /path/to/project.bundle ``` 1. Go to the `project.git` directory: @@ -134,6 +134,12 @@ To purge files from a GitLab repository: Repeat this step and all following steps (including the [repository cleanup](#repository-cleanup) step) every time you run any `git filter-repo` command. +1. To allow you to force push the changes you need to unset the mirror flag: + + ```shell + git config --unset remote.origin.mirror + ``` + 1. Force push your changes to overwrite all branches on GitLab: ```shell @@ -167,9 +173,7 @@ To purge files from a GitLab repository: ## Repository cleanup -> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/19376) in GitLab 11.6. - -Repository cleanup allows you to upload a text file of objects and GitLab removes internal Git +Repository cleanup allows you to upload a text file of objects and GitLab removes internal Gitlab references to these objects. You can use [`git filter-repo`](https://github.com/newren/git-filter-repo) to produce a list of objects (in a `commit-map` file) that can be used with repository cleanup. @@ -180,6 +184,10 @@ of the operation. This happens automatically, but submitting the cleanup request fails if any writes are ongoing, so cancel any outstanding `git push` operations before continuing. +WARNING: +Removal of internal Gitlab references will result in associated merge request commits, pipelines, and changes details +no longer being available. + To clean up a repository: 1. Go to the project for the repository. -- GitLab From e0264b98647639cd4cb4acbc9ccc184808ef627d Mon Sep 17 00:00:00 2001 From: Justin Farmiloe Date: Wed, 7 Jun 2023 05:11:27 +0000 Subject: [PATCH 2/4] Fix typos --- .../project/repository/reducing_the_repo_size_using_git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/user/project/repository/reducing_the_repo_size_using_git.md b/doc/user/project/repository/reducing_the_repo_size_using_git.md index ecee96a6e35454..fd90a959f8c434 100644 --- a/doc/user/project/repository/reducing_the_repo_size_using_git.md +++ b/doc/user/project/repository/reducing_the_repo_size_using_git.md @@ -173,7 +173,7 @@ To purge files from a GitLab repository: ## Repository cleanup -Repository cleanup allows you to upload a text file of objects and GitLab removes internal Gitlab +Repository cleanup allows you to upload a text file of objects and GitLab removes internal GitLab references to these objects. You can use [`git filter-repo`](https://github.com/newren/git-filter-repo) to produce a list of objects (in a `commit-map` file) that can be used with repository cleanup. @@ -185,7 +185,7 @@ fails if any writes are ongoing, so cancel any outstanding `git push` operations before continuing. WARNING: -Removal of internal Gitlab references will result in associated merge request commits, pipelines, and changes details +Removal of internal GitLab references will result in associated merge request commits, pipelines, and changes details no longer being available. To clean up a repository: -- GitLab From 83725d426a1f0c93d106e38502f65de8e1fcefaf Mon Sep 17 00:00:00 2001 From: Evan Read Date: Thu, 8 Jun 2023 00:12:14 +0000 Subject: [PATCH 3/4] Apply 2 suggestion(s) to 1 file(s) --- .../project/repository/reducing_the_repo_size_using_git.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/user/project/repository/reducing_the_repo_size_using_git.md b/doc/user/project/repository/reducing_the_repo_size_using_git.md index fd90a959f8c434..2813d079bf5d2f 100644 --- a/doc/user/project/repository/reducing_the_repo_size_using_git.md +++ b/doc/user/project/repository/reducing_the_repo_size_using_git.md @@ -173,7 +173,7 @@ To purge files from a GitLab repository: ## Repository cleanup -Repository cleanup allows you to upload a text file of objects and GitLab removes internal GitLab +Repository cleanup allows you to upload a text file of objects and GitLab removes internal Git references to these objects. You can use [`git filter-repo`](https://github.com/newren/git-filter-repo) to produce a list of objects (in a `commit-map` file) that can be used with repository cleanup. @@ -185,7 +185,7 @@ fails if any writes are ongoing, so cancel any outstanding `git push` operations before continuing. WARNING: -Removal of internal GitLab references will result in associated merge request commits, pipelines, and changes details +Removing internal GitLab references results in associated merge request commits, pipelines, and changes details no longer being available. To clean up a repository: -- GitLab From 37229d781dee1d9e0565c1b853483b5f6752c0b4 Mon Sep 17 00:00:00 2001 From: Evan Read Date: Thu, 8 Jun 2023 00:18:26 +0000 Subject: [PATCH 4/4] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/repository/reducing_the_repo_size_using_git.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/project/repository/reducing_the_repo_size_using_git.md b/doc/user/project/repository/reducing_the_repo_size_using_git.md index 2813d079bf5d2f..ce3a5ee99168d6 100644 --- a/doc/user/project/repository/reducing_the_repo_size_using_git.md +++ b/doc/user/project/repository/reducing_the_repo_size_using_git.md @@ -185,7 +185,7 @@ fails if any writes are ongoing, so cancel any outstanding `git push` operations before continuing. WARNING: -Removing internal GitLab references results in associated merge request commits, pipelines, and changes details +Removing internal Git references results in associated merge request commits, pipelines, and changes details no longer being available. To clean up a repository: -- GitLab