From 33fb56bf443ee73f589cc7d2a2c1a3d162b4617f Mon Sep 17 00:00:00 2001 From: root Date: Tue, 26 Sep 2017 21:09:13 +0100 Subject: [PATCH] etc/profile.d/git.sh --- etc/profile.d/git.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 +} -- 2.47.3