Skip to content

Instantly share code, notes, and snippets.

@WilliamDenniss
Created September 17, 2017 20:04
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 WilliamDenniss/f161224c2590551ab10a59d0b2ecbd1d to your computer and use it in GitHub Desktop.
Save WilliamDenniss/f161224c2590551ab10a59d0b2ecbd1d to your computer and use it in GitHub Desktop.
Creates a tag with a common format for an old branch, gives instructions to delete.
#!/bin/bash
git tag -a archive/$1 $1 -m "Archive of branch $1."
echo "Branch: `git rev-parse $1`"
echo "Tag: `git rev-list -n 1 archive/$1`"
echo "Run: git push origin --delete $1"
echo " git branch -d $1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment