Skip to content

Instantly share code, notes, and snippets.

@trinhvanminh
Created September 22, 2023 04:16
Show Gist options
  • Save trinhvanminh/1ed5ffed40d8a83980e5108c81bbd3f9 to your computer and use it in GitHub Desktop.
Save trinhvanminh/1ed5ffed40d8a83980e5108c81bbd3f9 to your computer and use it in GitHub Desktop.
Work with multiple git repository. Enter branch, enter git command and let it work.
@echo off
set /p branch=Branch (master):
set /p git_command=Git command (fetch):
if "%branch%"=="" set branch=master
if "%git_command%"=="" set git_command=fetch
for /d %%i in (%cd%\*) do (
echo *************************************************************************
echo "%%i"
cd "%%i"
echo -----------------------------------------
git checkout %branch%
echo [%branch%] %git_command%ing...
git %git_command%
echo -----------------------------------------
echo *************************************************************************
)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment