Skip to content

Instantly share code, notes, and snippets.

@ivankristianto
Created February 23, 2017 02:54
Show Gist options
  • Save ivankristianto/b57d7277087d2d8627ccd249a905a3d4 to your computer and use it in GitHub Desktop.
Save ivankristianto/b57d7277087d2d8627ccd249a905a3d4 to your computer and use it in GitHub Desktop.
Archive Git Branch
arcdel() {
if [ -z $1 ]; then
echo "Error: missing branch name"
else
git checkout $1
git pull origin $1
git tag archive/$1
git push origin archive/$1
git checkout master
git push origin --delete $1
git branch -d $1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment