Skip to content

Commit

Permalink
bat script to update all repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed May 10, 2024
1 parent 8cde419 commit 72b44db
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions gitupdate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
for /d %%i in (%cd%\*) do (CALL :do_dir %%i %~1 || EXIT /B)
ECHO SUCCESS!
EXIT /B

:do_dir
cd %~1
git fetch
if %ERRORLEVEL% EQU 0 (
(CALL :do_git %~2 || EXIT /B 1)
)
cd ..
EXIT /B

:do_git
(git checkout master && call :do_default master %~1) || (git checkout main && CALL :do_default main %~1) || EXIT /B 1
EXIT /B

:do_default
(git merge origin/%~1) || (EXIT /B 1)
(git checkout %~2) || (EXIT /B 0)
(git merge %~1 || EXIT /B 1)
git merge origin/%~2
EXIT /B 0

0 comments on commit 72b44db

Please sign in to comment.