1
0
Fork 0
forked from infra/docs

feat(remove_file_from_distgit_sop): adjusting documentation SOP

Signed-off-by: Anton Medvedev <amedvede@redhat.com>
This commit is contained in:
Anton Medvedev 2025-12-22 15:16:01 +01:00
commit c087417141

View file

@ -41,12 +41,24 @@ To remove unwanted tarballs and source RPMs from a specific branch of a package
cd /srv/git/repositories/rpms/PKG_NAME.git
----
. Disable warning messages:
+
----
FILTER_BRANCH_SQUELCH_WARNING=1
----
. Rewrite history on the desired branch:
+
----
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch *.src.rpm *.tar.gz' --original refs/archive -- BRANCH
git filter-branch --force --index-filter 'git rm -r --cached --ignore-unmatch *.src.rpm *.tar.gz' --original refs/archive -- BRANCH
----
[NOTE]
====
Replace `*.src.rpm *.tar.gz` with the actual file name, that you would like to remove.
If you want to remove file from all branches use `--all` instead of `BRANCH`.
====
. Move the backup reference:
+
----
@ -66,4 +78,18 @@ Replace `BRANCH` with the target branch name.
====
== Verification
Verify the unwanted files have been removed from the branch history.
Verify the unwanted files have been removed from the branch history.
. Run Verification
+
----
git for-each-ref --format='%(refname:short)' | while read branch; do
echo "Checking $branch:"
git ls-tree -r $branch --name-only | grep -q "$FILE_NAME" && echo "FOUND in $branch" || echo "Not in $branch"
done
----
[NOTE]
====
Use actual file name instead of `$FILE_NAME`.
====