new: Added Instructions to wipe a repository.

This commit is contained in:
jj 2025-05-21 14:41:08 +02:00
parent f24a7033d1
commit a8d23484cd

View file

@ -131,4 +131,14 @@ git branch -m main wikiMaster
git push origin HEAD
```
Wipe a whole git repository, removing all branches, tags, and history, leaving behind only a single, empty main branch.
```bash
git checkout --orphan main && \
git rm -rf . && \
git commit --allow-empty -m "Initialize empty main branch" --no-verify && \
git push origin main --force && \
git for-each-ref --format='%(refname:short)' refs/heads/ | grep -v '^main$' | xargs -I{} git push origin --delete {} && \
git tag -l | xargs -n 1 git push --delete origin
```