git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Jens Axboe <axboe@suse.de>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git merging
Date: Fri, 17 Jun 2005 11:50:39 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0506171142500.2268@ppc970.osdl.org> (raw)
In-Reply-To: <20050617183914.GX6957@suse.de>


[ Git mailing list cc'd, since this is a general question that maybe 
  others have wondered about ]

On Fri, 17 Jun 2005, Jens Axboe wrote:
> 
> btw (and forgive me for just asking you), what is the canonical way to
> kill a branch in case you want to redo it? right now I have a block tree
> with a bunch of brances, and I would like to redo one of the branches
> because I forgot to add the signed-off-by entries in there.

You can just simply remove the .git/refs/heads/branch-name file (obviously 
after having made sure that ".git/HEAD" points to something else), and 
then you can run "git prune", which will remove all objects that aren't 
referenced (directly or indirectly) by anything in ".git/refs/**".

Be very very careful, though. "git prune" is a dangerous script, since it
will remove objects from the object store. If you had something that you
don't have a proper reference for, or if you give "git prune" a list of
references manually and it's not complete, "git prune" will happily remove
objects that you didn't mean for it to remove.

The "git prune" script is really trivial, you can see for yourself what 
"git-prune-script" does.

NOTE! It's entirely possible to not actually delete the old branch, but 
just rename it, and use it as a reference while you build up the new 
branch with the same contents (but maybe different commit log messages, or 
maybe just re-ordering the commits in the new version). To rename a 
branch, just rename the ".git/refs/heads/<branch-name>" file to something 
else.

So you may decide to remove (and prune) the old branch only after you've 
re-created a new version of it, for example. That way you can use git 
itself to extract the contents of the branch you want to re-do, which is 
often easier.

Btw, if you have a recent version of "gitk" instealled, you can do

	gitk $(ls .git/revs/heads)

and you'll get a full graphical view of _all_ your branches, which can be 
very instructive.

		Linus

       reply	other threads:[~2005-06-17 18:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050617133440.GI6957@suse.de>
     [not found] ` <Pine.LNX.4.58.0506170937260.8487@ppc970.osdl.org>
     [not found]   ` <20050617175653.GS6957@suse.de>
     [not found]     ` <Pine.LNX.4.58.0506171101450.2268@ppc970.osdl.org>
     [not found]       ` <20050617181156.GT6957@suse.de>
     [not found]         ` <Pine.LNX.4.58.0506171132390.2268@ppc970.osdl.org>
     [not found]           ` <20050617183914.GX6957@suse.de>
2005-06-17 18:50             ` Linus Torvalds [this message]
2005-06-17 19:16               ` git merging Jens Axboe
2005-06-17 23:08               ` Jeff Garzik
2005-06-17 23:31                 ` Linus Torvalds
2005-06-17 23:51                   ` Jeff Garzik
2005-06-18  0:13                     ` Linus Torvalds
2005-06-20 12:30                       ` Jens Axboe
2005-06-20 13:48                         ` Matthias Urlichs
2005-06-20 14:13                           ` Jens Axboe
2005-06-20 15:58                         ` Linus Torvalds
2005-06-20 16:06                           ` Daniel Barkalow
2005-06-20 19:21                             ` Matthias Urlichs
2005-06-20 20:38                           ` Jens Axboe
2005-06-20 21:15                             ` Linus Torvalds
2005-06-21 14:59                               ` Jens Axboe
2005-06-21 15:53                                 ` Linus Torvalds

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0506171142500.2268@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=axboe@suse.de \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).