Every few months, I get grumpy when my "git branch -a" command fills up the screen and it looks like there is a bunch of branches that are not being worked on, or that have been merged, or can otherwise be archived. So, I will move the "dead wood" branches from the branches to tags. {subsection: What gets bag-n-tagged} I just run a script that looks for branches that are more than 90 days old: {code} git for-each-ref --format='%(refname)' refs/remotes/origin | { exp=$(( $(date +'%s') - 7776000 )); while read ref; do if test ${exp} -gt $(git show -s --pretty=format:'%ct' $ref); then echo $ref fi done; } {endcode} I then email htcondor-devel to politely ask if I can bag-n-tag the branches listed. {subsection: When a branch gets bag-n-tagged} I create a tag with the name of the branch, ending in "-tag". So branch "foo" will get tagged with tag "foo-tag". I run the following git commands {code} git tag -a -m "Bag-n-tag branch foo" foo-tag foo # To create the foo-tag tag git push origin tag foo-tag # To publish the new tag git push origin :refs/heads/foo # To delete the branch {endcode} {subsection: How to resurrect a branch} If a branch is overzealously deleted, it is easy to restore. You may still have the old reference around, so you could run {code} git push origin refs/remotes/origin/foo:refs/heads/foo {endcode} to simply copy the old reference back to the condor repository If you have only the tag, you can do the following {code} git branch foo foo-tag^{} git push origin foo:foo {endcode} to restore the branch. Here is the actual script: {code} #!/bin/bash GIT_DIR=/p/condor/repository/CONDOR_SRC.git export GIT_DIR bag_n_tag() { trimmed_branch_name=$(echo $1 | sed 's|^refs/remotes/origin/||;s|^refs/heads/||') origin_ref=refs/remotes/origin/${trimmed_branch_name} cat <