[Bioperl-l] move ancient branches to attic

Robert Buels rmb32 at cornell.edu
Fri May 14 18:38:10 UTC 2010


At the PDX hackathon last night, I was talking about this problem with a 
git expert, and he gave me a little tutorial on how git thinks about and 
keep branches and tags.

Each of these things is just a special case of a 'ref', which is just a 
reference to the end of some piece of the commit graph.  If you run

    git ls-remote http://github.com/bioperl/bioperl-live.git

you can see all the refs we currently have in our bioperl-live repo, 
which are all in either /refs/heads (which are our branches), or 
/refs/tags (our tags).

Now, it turns out you can have arbitrary things in here in addition to 
heads and tags.  I copied one of the old branches to 
/refs/archives/branch-ensembl-m1 to demonstrate this.  Now, it doesn't 
show up in normal workflow listings, but it's not deleted.  If somebody 
wanted to resurrect it, they could move or copy it into /refs/heads 
(where it would show up as as an active branch again).

To copy a branch into archives/,

   git push origin origin/<branch name>:refs/archives/<branch name>

To *move* a branch into archives/

   git push origin origin/<branch>:refs/archives/<branch> \
                  :refs/heads/<branch>

The first part of that second part of that push has nothing on the left 
side of the colon, which pushes a 'null' to refs/heads/<branch>, which 
deletes it.  You can have an arbitrary number of these kinds of commands 
in each push invocation.

So, there's a good mechanism for archiving our old branches.

Rob




More information about the Bioperl-l mailing list