-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit.bat
More file actions
52 lines (46 loc) · 872 Bytes
/
commit.bat
File metadata and controls
52 lines (46 loc) · 872 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@echo off
setlocal
echo.
echo ============================================
echo Finalmouse Polling Rate Switcher - Commit
echo ============================================
echo.
:: Check for git
git --version >nul 2>&1
if errorlevel 1 (
echo ERROR: git not found!
pause
exit /b 1
)
:: Show status
echo Changes:
echo.
git status --short
echo.
:: Ask for commit message
set /p MSG="Commit message: "
if "%MSG%"=="" (
echo ERROR: Commit message cannot be empty.
pause
exit /b 1
)
:: Stage, commit, push
git add -A
git commit -m "%MSG%"
if errorlevel 1 (
echo ERROR: Commit failed!
pause
exit /b 1
)
git push
if errorlevel 1 (
echo ERROR: Push failed!
pause
exit /b 1
)
echo.
echo ============================================
echo PUSHED TO GITHUB
echo ============================================
echo.
pause