Auto-update: Tue Jul 30 19:54:28 PDT 2024
This commit is contained in:
parent
c281d3ac38
commit
95dba1db36
1 changed files with 17 additions and 0 deletions
17
gitpurge
Executable file
17
gitpurge
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Fetch the latest changes from the remote repository
|
||||||
|
git fetch origin
|
||||||
|
|
||||||
|
# Checkout the main branch
|
||||||
|
git checkout main
|
||||||
|
|
||||||
|
# Delete files that are not on the main branch
|
||||||
|
git ls-tree -r main --name-only | xargs -I {} git rm -r {}
|
||||||
|
|
||||||
|
# Commit the changes
|
||||||
|
git commit -m "Remove files not on the main branch"
|
||||||
|
|
||||||
|
# Push the changes to the remote repository
|
||||||
|
git push origin main
|
||||||
|
|
Loading…
Reference in a new issue