Skip to content

Instantly share code, notes, and snippets.

@andriyun
Last active December 8, 2016 10:41
Show Gist options
  • Save andriyun/18b7aa3526945c5cdede7a75093d7eda to your computer and use it in GitHub Desktop.
Save andriyun/18b7aa3526945c5cdede7a75093d7eda to your computer and use it in GitHub Desktop.
current_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/*\(.*\)/\1/'
}
mrgto(){
branch="$(current_git_branch)"
git checkout $1
git fetch origin $1
git merge origin/$1
git merge $branch
git checkout $branch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment