forked from threemay/myDevOps_directory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3GitCheck.sh
49 lines (33 loc) · 787 Bytes
/
3GitCheck.sh
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
#!/bin/bash
# the first parameter should be the master branch name
# the first parameter should be the feature branch name
# this check is checking the head main branch commit is contained
# in feature branch
# if no contain, exit with 1 code
# remoteURL=$(git config --get remote.origin.url)
# git remote add my ${remoteURL}
# git fetch origin $1
# git fetch my $2
# git checkout $1
# git checkout $2
# OUT=$(git rev-parse $1)
# echo ${OUT}
# git remote -v
# git log $2
# git log my/$2..origin/$1
# git log origin/$1..origin/$2
# if [[ $(git log $2..$1) ]]
# then
# echo "there are files"
# else
# echo "no files found"
# fi
# git log origin/$2
# if [[ $(git log) =~ "${OUT}" ]]
# then
# echo "OK"
# exit 0
# else
# echo "no"
# exit 1
# fi