Skip to content

Instantly share code, notes, and snippets.

@idcmp
Created November 25, 2013 20:08
Show Gist options
  • Save idcmp/7647931 to your computer and use it in GitHub Desktop.
Save idcmp/7647931 to your computer and use it in GitHub Desktop.
[idcmp@idcmp ~]$ cat ~/bin/git-finish
#!/bin/bash
if [ "$1" = "." ]; then
GIT_BRANCH=`git branch --no-color | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
elif [ -z "$1" ]; then
echo "Please specify the branch name."
exit 1
else
GIT_BRANCH=$1
fi
git branch $GIT_BRANCH -m merged/$GIT_BRANCH
git co master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment