首页
首页

Git自动更新

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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@Echo off
color 0e
Title Git 更新
:begin
d:
cd D:\1\2
cls
Echo.请选择需要的操作
Echo 1 更新主分支
Echo 2 更新2
Echo.
Echo 3 切换到主分支
Echo 4 切换到2
Echo.
::Echo 6 服务器切换为内网
::Echo 7 服务器切换为外网
Echo 8 更新3
Echo.
Echo 9 强更主分支
Echo.
Echo 0 退出

Set /P Choice= 请输入数字 ,然后按回车:


If not "%Choice%"=="" (
If "%Choice%"=="0" (
exit
)

If "%Choice%"=="9" (
Echo on
git fetch --all && git reset --hard origin/master && git pull
pause
Echo off
goto :begin
)

If "%Choice%"=="8" (
Echo on
cd D:\3
git pull origin master
pause
cd D:\1\2
Echo off
goto :begin
)

If "%Choice%"=="7" (
goto serverA
goto :begin
)

If "%Choice%"=="6" (
goto serverB
goto :begin
)

If "%Choice%"=="4" (
Echo on
git checkout 3
pause
Echo off
goto :begin
)

If "%Choice%"=="3" (
Echo on
git checkout master
pause
Echo off
goto :begin
)

If "%Choice%"=="2" (
Echo on
git pull origin 3
pause
Echo off
goto :begin
)

If "%Choice%"=="1" (
Echo on
git pull origin master
pause
Echo off
goto :begin
)
)
Echo. pause