Skip to content

Instantly share code, notes, and snippets.

@chestozo
Created June 8, 2012 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chestozo/2894548 to your computer and use it in GitHub Desktop.
Save chestozo/2894548 to your computer and use it in GitHub Desktop.
Merge to master
function __get_git_branch {
local br=""
local git="$(git symbolic-ref HEAD 2> /dev/null)"
# git
if [ -n "$git" ]; then
br="${git##refs/heads/}"
fi
echo "$br"
}
function merge-to-master {
local br=$(__get_git_branch)
git co master
git pull
git merge $br
git co -
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment