aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/check_upstream.sh
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2019-04-18 11:20:05 +0800
committertypebrook <typebrook@gmail.com>2019-04-18 11:20:05 +0800
commitb9767d94390bf96165d65a829d2aab37bda37258 (patch)
tree5a43b9e9273734abae601dafa996dee2bb58e5da /scripts/check_upstream.sh
parent8b2aa66c644e7bf1e2bc129b84da4603f52cae1f (diff)
update
Diffstat (limited to 'scripts/check_upstream.sh')
-rw-r--r--scripts/check_upstream.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/check_upstream.sh b/scripts/check_upstream.sh
new file mode 100644
index 0000000..888061e
--- /dev/null
+++ b/scripts/check_upstream.sh
@@ -0,0 +1,19 @@
1# check git repo $1 if upstream branch
2# origin/master is ahead of local branch $2(default to dev)
3check_upstream() {
4
5 head='dev'
6 if [ $# -eq 2 ]
7 then
8 head=$2
9 fi
10
11 cd ~/$1
12 git fetch origin && \
13 git rev-list $head | grep $(git rev-parse origin/master) > /dev/null
14
15 if [ $? -ne 0 ]
16 then
17 echo "New commit at" $1
18 fi
19}