Files
workspace/git_commit_push_master.bat
T
2026-05-07 21:34:09 +08:00

38 lines
576 B
Batchfile

@echo off
setlocal
cd /d "%~dp0"
for /f %%i in ('powershell -NoProfile -Command "Get-Date -Format yyyyMMddHHmmss"') do set COMMIT_MSG=%%i
echo Current directory:
cd
echo.
echo Commit message: %COMMIT_MSG%
echo.
echo Running: git add .
git add .
if errorlevel 1 goto error
echo.
echo Running: git commit -m "%COMMIT_MSG%"
git commit -m "%COMMIT_MSG%"
if errorlevel 1 goto error
echo.
echo Running: git push origin master
git push origin master
if errorlevel 1 goto error
echo.
echo Done.
pause
exit /b 0
:error
echo.
echo Failed. See the message above.
pause
exit /b 1