-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgit-auto.bat
More file actions
37 lines (32 loc) · 810 Bytes
/
git-auto.bat
File metadata and controls
37 lines (32 loc) · 810 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
@echo off
cd /d E:\Downlodes\STUDY\WEB\UIU-Web-Programming
echo ------------------------------
echo Pulling latest changes...
git pull
echo ------------------------------
echo Checking Git status...
git status
echo ------------------------------
git status --porcelain > changes.txt
for /f %%i in (changes.txt) do set HAS_CHANGES=1
if not defined HAS_CHANGES (
echo No changes found. Exiting...
del changes.txt
exit
)
echo Changes detected!
git status --short
echo ------------------------------
set /p commit_msg="Enter commit message (or leave empty to cancel commit): "
if "%commit_msg%"=="" (
echo Commit canceled. Exiting...
del changes.txt
exit
)
git add -A
git commit -m "%commit_msg%"
git push
del changes.txt
echo ------------------------------
echo Push completed!
pause