Git Attic, take 2

Now that I come to use my git-attic script a little more (see previous post), I realise that the original work flow was a little clunky:

  1. Existing branches need to go in the attic, but never arbitrary commits.
  2. I never need to name the branch something different in the attic to when it was in my active branches.

To that end I made a few modifications. The "store" command now takes only one argument, which must be a branch in refs/heads. That branch is then moved to the attic (not copied as before.) The "remove" command has been renamed to "-d" (like for tags.) A new "get" command has been added to move branches back from the attic to the active branches:

Usage: git-attic
       git-attic store <branch-name>
       git-attic get <branch-name>
       git-attic -d <branch-name>

The modified script is attached.

Edit: The script will now also check that target refs don't exist before it writes to them. We don't want to overwrite an existing branch of the same name!


Filename/TitleSize
Git Attic (git-attic.)1.97 KB

Back to top