improve script

main
Dominik Madarász 2024-08-31 09:12:05 +02:00
parent 9facdb275c
commit d8f3d06bb1
1 changed files with 8 additions and 5 deletions

View File

@ -238,13 +238,16 @@ if "%1"=="push" (
exit /b 1
)
git fetch origin
git rev-parse HEAD > .git\FETCH_HEAD
fc .git\HEAD .git\FETCH_HEAD > nul
git status | findstr /C:"Changes to be committed:" > nul
if !ERRORLEVEL! equ 0 (
echo Already up to date with remote. Nothing to push.
echo There are staged changes. Proceeding with push.
) else (
git status | findstr /C:"Your branch is up to date with" > nul
if !ERRORLEVEL! equ 0 (
echo Your branch is already up to date. No need to push.
exit /b 0
)
)
git status
if "%2"=="dp" (