new: Added Instructions to wipe a repository.
This commit is contained in:
parent
f24a7033d1
commit
a8d23484cd
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue