From 6ec12cb59e20a56deb29dfacb8daac8f1edfcc3b Mon Sep 17 00:00:00 2001 From: Augustus <123775785+OlegTheSnowman@users.noreply.github.com> Date: Wed, 2 Jul 2025 14:09:26 +0300 Subject: [PATCH] Delete cleaner.bat --- cleaner.bat | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 cleaner.bat diff --git a/cleaner.bat b/cleaner.bat deleted file mode 100644 index 6c5600b..0000000 --- a/cleaner.bat +++ /dev/null @@ -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