From: root Date: Tue, 26 Sep 2017 20:09:13 +0000 (+0100) Subject: etc/profile.d/git.sh X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=33fb56bf443ee73f589cc7d2a2c1a3d162b4617f;p=nb.git etc/profile.d/git.sh --- diff --git a/etc/profile.d/git.sh b/etc/profile.d/git.sh index 459a5e0f..17a4db23 100644 --- a/etc/profile.d/git.sh +++ b/etc/profile.d/git.sh @@ -169,3 +169,22 @@ git_conn_check() { return 0 } +# NB 26.09.17: TODO +git_merge_from() { + local usage="Usage: git_merge_from BRANCH, but does not push !" + local from=${1:?$usage} + local branch=$(git branch 2>/dev/null|awk '/^\*/{print $2}') + [ -z "$branch" ] && echo "$usage" 1>&2 && return 1 + echo "git checkout $from && git pull && git checkout $branch && git merge $from" + return 0 +} + +# NB 26.09.17: TODO +git_merge_to() { + local usage="Usage: git_merge_to BRANCH and auto push branch to !" + local to=${1:?$usage} + local branch=$(git branch 2>/dev/null|awk '/^\*/{print $2}') + [ -z "$branch" ] && echo "$usage" 1>&2 && return 1 + echo "git checkout $to && git pull && git merge $branch && git push && git checkout $branch" + return 0 +}