Skip to content

Instantly share code, notes, and snippets.

@npanuhin
Last active July 15, 2021 18:04
Show Gist options
  • Save npanuhin/be3fe608a7cdb14121fdd5eb0b2348c6 to your computer and use it in GitHub Desktop.
Save npanuhin/be3fe608a7cdb14121fdd5eb0b2348c6 to your computer and use it in GitHub Desktop.
Run "git gc" recursively
@echo off
set ROOT_PATH="."
set COMMAND=git gc
FOR /R "%ROOT_PATH%" %%F IN (.) DO (
IF EXIST "%%F/.git" (
echo Handling "%%F"...
cd %%F
%COMMAND%
cd %ROOT_PATH%
echo;
)
)
echo Finished
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment