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 exit /b 1
) )
git fetch origin git status | findstr /C:"Changes to be committed:" > nul
git rev-parse HEAD > .git\FETCH_HEAD
fc .git\HEAD .git\FETCH_HEAD > nul
if !ERRORLEVEL! equ 0 ( 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 exit /b 0
) )
)
git status git status
if "%2"=="dp" ( if "%2"=="dp" (