Created
November 1, 2018 10:07
-
-
Save ytnobody/cc10fbbe52952b1c6e6b238d3b3d275e to your computer and use it in GitHub Desktop.
Revisions
-
ytnobody revised this gist
Nov 1, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ EOF keyword=$1; shift DST_BRANCH=$1; shift MEMOFILE=$HOME/.git-bar if [ -z $keyword ] || [ -z $DST_BRANCH ] ; then help; -
ytnobody created this gist
Nov 1, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ #!/bin/sh help () { cat <<EOF Usage: git-bar [keyword] [Dest Branch] EOF exit; } keyword=$1; shift DST_BRANCH=$1; shift MEMOFILE=$HOME/.git-overlay if [ -z $keyword ] || [ -z $DST_BRANCH ] ; then help; fi echo $keyword" ---> "$DST_BRANCH WORK_BRANCH="work/"$keyword BASE_BRANCH=`git branch | grep '*' | awk '{print($2);}'` git checkout $DST_BRANCH && git pull && git branch $WORK_BRANCH git checkout $BASE_BRANCH && git log --date-order --reverse --pretty=format:"%H | %s" | grep "| "$keyword | awk '{print($1);}' > $MEMOFILE git checkout $WORK_BRANCH && cat $MEMOFILE | awk '{print("git cherry-pick "$1);}' | sh