Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
git-misc-funcs
function gitcs () {
if [ -z $1 ]; then
echo "Missing commit number"
return 1
fi
git commit -am "TEMP" && git rebase -i HEAD~$1
}
function git-merge-to () {
if [ -z $1 ]; then
echo "Missing dest branch"
return 1
fi
CUR_BRANCH=$(git branch --points-at=HEAD -q | cut -d ' ' -f2)
if [ -z $CUR_BRANCH ]; then
echo "Current branch not found :("
return 1
fi
git checkout ${1} && git pull && git merge --no-ff ${CUR_BRANCH} && git push && git checkout ${CUR_BRANCH}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.