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:
parent
8766c39ea1
commit
c087417141
1 changed files with 28 additions and 2 deletions
|
|
@ -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`.
|
||||
====
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue