Updated
parent
424a2bdf00
commit
c3e45b2e51
|
|
@ -12,7 +12,7 @@ if [[ "$?" -ne "0" ]]; then
|
||||||
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
|
[[ "$0" = "$BASH_SOURCE" ]] && exit 1 || return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for branch in $(git branch -a | cut -b 2- | grep -v "remotes/origin" | awk '{print $1}');
|
for branch in $(git branch -a | cut -b 2- | grep "remotes/origin" | cut -f 3 -d '/' | awk '{print $1}');
|
||||||
do
|
do
|
||||||
# Skip anything that looks like Master
|
# Skip anything that looks like Master
|
||||||
if [[ ((-z "$branch") || ("$branch" = "master") || ("$branch" = "HEAD")) ]]; then
|
if [[ ((-z "$branch") || ("$branch" = "master") || ("$branch" = "HEAD")) ]]; then
|
||||||
|
|
@ -26,34 +26,38 @@ do
|
||||||
|
|
||||||
echo "**************** $branch *******************"
|
echo "**************** $branch *******************"
|
||||||
|
|
||||||
git checkout "$branch" &>/dev/null
|
git checkout -f "$branch" &>/dev/null
|
||||||
if [[ "$?" -ne "0" ]]; then
|
if [[ "$?" -ne "0" ]]; then
|
||||||
echo "git checkout $branch failed"
|
echo "git checkout $branch failed"
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git rebase "origin/$branch" &>/dev/null
|
git rebase "origin/$branch"
|
||||||
if [[ "$?" -ne "0" ]]; then
|
if [[ "$?" -ne "0" ]]; then
|
||||||
echo "git rebase $branch failed"
|
echo "git rebase $branch failed"
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git merge master -S -m "Merge branch 'master' into dev-branch '$branch'"
|
git merge master -S -m "Merge branch 'master' into dev-branch '$branch'" &>/dev/null
|
||||||
if [[ "$?" -ne "0" ]]; then
|
if [[ "$?" -ne "0" ]]; then
|
||||||
echo "git merge $branch failed"
|
echo "git merge $branch failed"
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git push
|
git push &>/dev/null
|
||||||
if [[ "$?" -ne "0" ]]; then
|
if [[ "$?" -ne "0" ]]; then
|
||||||
echo "git push $branch failed"
|
echo "git push $branch failed"
|
||||||
continue;
|
continue;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Completed merging for '$branch'"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ ! -z "$current" ]]; then
|
if [[ ! -z "$current" ]]; then
|
||||||
git checkout "$current" &>/dev/null
|
git checkout "$current" &>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Back on branch $current"
|
||||||
|
|
||||||
[[ "$0" = "$BASH_SOURCE" ]] && exit 0 || return 0
|
[[ "$0" = "$BASH_SOURCE" ]] && exit 0 || return 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue