-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_check_and_merge_utility.bat
More file actions
86 lines (73 loc) · 1.94 KB
/
git_check_and_merge_utility.bat
File metadata and controls
86 lines (73 loc) · 1.94 KB
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
@echo off
setlocal EnableDelayedExpansion
cd ..
if not ""=="%1" (
set branch_name=%1
) else (
set branch_name=test
)
echo !branch_name!
pause
set current_path=!CD!
ECHO %current_path%
ECHO !current_path!
(for %%a in (
ember-masonry-grid
bbhverse
loopback
qms
ember-searchable-select
loopback-component-jsonapi
config
loopback-connector-ds
) do (
cd %%a
echo %%a
git rev-parse --abbrev-ref HEAD>!current_path!\git_branch.txt
REM pause
set /p git_current_branch=<!current_path!\git_branch.txt
echo !git_current_branch!
REM pause
if !git_current_branch! == test (
echo !git_current_branch! ">>>>>>>>>>>>>>>>>>>>>>"
if %%a == qms (
git pull origin test
git checkout genericMRwip
git pull origin genericMRwip
git checkout test
git merge genericMRwip
git push origin test
) else (
git pull origin !branch_name!
git checkout master
git pull
git checkout !branch_name!
git merge master
git push origin !branch_name!
)
) else (
echo !git_current_branch! ">>>>>>>>>>>>>>"
REM If the specified branch is not there,List available branches,and ask user to verify,if required we can create it
if %%a == qms (
git checkout !branch_name!
git pull origin !branch_name!
git checkout genericMRwip
git pull origin genericMRwip
git checkout !branch_name!
git merge genericMRwip
git push origin !branch_name!
) else (
git checkout !branch_name!
git pull origin !branch_name!
git checkout master
git pull
git checkout !branch_name!
git merge master
git push origin !branch_name!
)
)
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>"
pause
cd ..
))
del "!current_path!\git_branch.txt"