git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tim Chase <git@tim.thechases.com>
To: git@vger.kernel.org
Subject: Archiving off old branches
Date: Wed, 23 Apr 2014 12:08:50 -0500	[thread overview]
Message-ID: <20140423120850.3f6fb535@bigbox.christie.dr> (raw)

I've got a branch for each bug/issue and it was getting a bit
unwieldy.  A little searching suggested this

  # archive off the BUG-123 branch
  git update-ref refs/closed/BUG-123 BUG-123
  git branch -D BUG-123

which seems to do exactly what I want -- branches are archived off so
they still have refs, but they don't appear in the output of "git
branch".

Reading up on "git help update-ref", it states that it updates the
name "safely".  As best I can tell, the above process does something
like

  cd .git/refs
  mkdir -p closed
  mv heads/BUG-123 closed

Is there something unsafe about this?  The advantage to the latter
would be that I could do a bunch of them easily:

  mv heads/BUG-{123,234,345,456,567} closed

but I want to make sure I'm not screwing something up unsafely.  Is
there some key element to "update-ref"'s safety that I'm missing?

-tkc

             reply	other threads:[~2014-04-23 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23 17:08 Tim Chase [this message]
2014-04-23 17:43 ` Archiving off old branches Junio C Hamano
2014-04-23 17:58 ` Jonathan Nieder
2014-04-23 18:06   ` Tim Chase
2014-04-23 18:15   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140423120850.3f6fb535@bigbox.christie.dr \
    --to=git@tim.thechases.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).