Delete cleaner.bat

This commit is contained in:
Augustus
2025-07-02 14:09:26 +03:00
parent ed7e043643
commit 6ec12cb59e

View File

@@ -1,35 +0,0 @@
@echo off
echo This script will rewrite git history, keeping only the last commit as the new root.
echo It will also force push to your remote. BACK UP FIRST!
pause
REM Get the current branch name into a variable
FOR /F "delims=" %%i IN ('git rev-parse --abbrev-ref HEAD') DO set CURRENT_BRANCH=%%i
echo Current branch is: %CURRENT_BRANCH%
pause
REM Create a temporary branch from the last commit
git checkout --orphan temp_branch
REM Reset temp_branch to the last commit (keeps files staged)
git reset --hard HEAD
REM Delete old branch
git branch -D %CURRENT_BRANCH%
REM Rename temp_branch to original branch name
git branch -m %CURRENT_BRANCH%
REM Force garbage collection to remove old commits
git reflog expire --expire=now --all
git gc --prune=now --aggressive
echo Will now force push to remote!
pause
REM Force push to remote origin (replace with your remote if needed)
git push -f origin %CURRENT_BRANCH%
echo Done! The repo now only contains the last commit as the initial release.
pause