diff options
Diffstat (limited to 'scripts/check_upstream.sh')
-rw-r--r-- | scripts/check_upstream.sh | 19 |
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) | ||
3 | check_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 | } | ||