-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitAutoPush.bat
61 lines (49 loc) · 1.18 KB
/
.gitAutoPush.bat
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
53
54
55
56
57
58
59
60
61
@echo off
REM Script to quickly and automatically Push and Pull to/from Github
REM 1.1 - 2021/08/16
REM Changed the date and compName string format: YYYY/MM/DD - TIME (COMPNAME)
REM Updated file name to gitAutoPush
:GETCURRDIR
for %%I in (.) do set currDirName=%%~nxI
@title = %currDirName% - gitAutoPush V1.1
git status
:GETTIME
FOR /F "TOKENS=1 eol=/ DELIMS=/ " %%A IN ('TIME/T') DO SET time=%%A
:GETDATE
set year=%date:~10,4%
set month=%date:~4,2%
set day=%date:~7,2%
SET todaysdate=%yyyy%
:GETCOMPNAME
FOR /F "usebackq" %%i IN (`hostname`) DO SET compName=%%i
set message=Updated %year%/%month%/%day% - %time% (%compName%)
:MENU
@echo.
REM @echo. ________________________________________________________________
@echo. ----------------------------------------------------------------
@echo.
@echo. Message : %message%
@echo.
@echo. 1 = GIT PUSH
@echo. 2 = GIT PULL
@echo. 3 = EXIT
@echo.
@echo.
@echo off
SET /P M=Type 1,2,3,4 or 5 then press ENTER:
IF %M%==1 GOTO PUSH
IF %M%==2 GOTO PULL
IF %M%==3 GOTO EOF
:PUSH
cls
git add -A
git status
git commit -m "%message%"
git push
GOTO MENU
:PULL
cls
git pull
GOTO MENU
:EOF
exit