From 46df147cc255eb29768e85d89bc88cf8e6a95fcd Mon Sep 17 00:00:00 2001 From: danilkuznetsov Date: Mon, 13 Oct 2014 19:55:37 +0300 Subject: [PATCH 1/3] Added merge upstream script --- script/merge_upstream.sh | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 script/merge_upstream.sh diff --git a/script/merge_upstream.sh b/script/merge_upstream.sh new file mode 100755 index 0000000..f0b35a0 --- /dev/null +++ b/script/merge_upstream.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Update source code from main repository + +# Pop any stashed changes +unstash() { +if [[ "$stash" =~ "No local changes to save" ]]; then +echo "* No stashed changes, not popping" +else +echo "* Popping stash..." +git stash pop +fi +} + +# Pop any stashed changes and exit +rollback() { +echo +echo "Something went wrong, rolling back" +unstash +exit $1 +} + +# Stash any local change" +echo "* Stash any local changes" +stash=$(git stash) + +remote_upstream="upstream" +remote_upstream_master_branch="master" + +upstream_remote_exists=$(git branch -r --no-color | egrep "$remote_upstream/$remote_upstream_master_branch\$") + +if [ -n "$upstream_remote_exists" ] && [ ! "$upstream_remote_exists" == '' ]; then + echo "* Upstream remote branch exists ....." +else + echo "* Adding upstream remote branch" + git remote add upstream https://github.com/interview-com-ua/website.git +fi + +echo "* Fetching from upstream " +git fetch upstream || rollback $? +echo "* Checkout local master " +git checkout master +echo "* Merge local master and upstream/master" +git merge upstream/master || rollback $? +echo "* Push changes into remote origin/master" +git push origin + +unstash +read -rp "* Done. Press any key to continue..." key From 5bf689394d24fa0699e88d42f7e21350e21a37a1 Mon Sep 17 00:00:00 2001 From: Danil Kuznetsov Date: Mon, 13 Oct 2014 20:10:33 +0300 Subject: [PATCH 2/3] Added upstream script for windows --- script/merge_upstream_windows.sh | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 script/merge_upstream_windows.sh diff --git a/script/merge_upstream_windows.sh b/script/merge_upstream_windows.sh new file mode 100644 index 0000000..0ce4742 --- /dev/null +++ b/script/merge_upstream_windows.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# Update source code from main repository + +# Pop any stashed changes +unstash() { +if [ "$stash" != "No local changes to save" ]; then +echo "* No stashed changes, not popping" +else +echo "* Popping stash..." +git stash pop +fi +} + +# Pop any stashed changes and exit +rollback() { +echo +echo "Something went wrong, rolling back" +unstash +exit $1 +} + +# Stash any local change" +echo "* Stash any local changes" +stash=$(git stash) + +remote_upstream="upstream" +remote_upstream_master_branch="master" + +upstream_remote_exists=$(git branch -r --no-color | egrep "$remote_upstream/$remote_upstream_master_branch\$") + +if [ -n "$upstream_remote_exists" ] && [ ! "$upstream_remote_exists" == '' ]; then + echo "* Upstream remote branch exists ....." +else + echo "* Adding upstream remote branch" + git remote add upstream https://github.com/interview-com-ua/website.git +fi + +echo "* Fetching from upstream " +git fetch upstream || rollback $? +echo "* Checkout local master " +git checkout master +echo "* Merge local master and upstream/master" +git merge upstream/master || rollback $? +echo "* Push changes into remote origin/master" +#git push origin + +unstash +read -rp "* Done. Press any key to continue..." key From 7dc08292a24964f82035a808b02cb029187ec1d3 Mon Sep 17 00:00:00 2001 From: danilkuznetsov Date: Wed, 15 Oct 2014 09:34:20 +0300 Subject: [PATCH 3/3] Test commit 123 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 34403f9..984f248 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ chromedriver.log *.class #Test123 +#test1234 # Package Files # *.jar *.war