-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-push.bat
More file actions
34 lines (28 loc) · 744 Bytes
/
Copy pathgit-push.bat
File metadata and controls
34 lines (28 loc) · 744 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off
echo ========================================
echo Quick Push to GitHub
echo ========================================
set /p msg="Commit message: "
if "%msg%"=="" set msg="Update %date% %time%"
echo.
echo Adding files...
git add .
echo.
echo Committing: %msg%
git commit -m "%msg%"
echo.
echo Pushing to GitHub...
git push -u origin main
if errorlevel 1 (
echo.
echo ========================================
echo Push failed! Trying force push...
echo ========================================
set /p force="Force push? (y/n): "
if /i "%force%"=="y" git push -u origin main --force
)
echo.
echo ========================================
echo Done!
echo ========================================
pause