On Sat, Apr 9, 2011 at 11:30 PM, Mike Orr <[email protected]> wrote:
> Does deleting a branch erase it from the repository? Only if you push the deletion, which you can do via $ git push remote :doomed-branch (that's some odd syntax, I'll grant ya.) $ git push --delete remote doomed-branch may work too. > Does it erase its > changesets? If they're not "reachable" by any other ref, and if (I think) 30 days passes, then they are indeed erased. Even without the passage of 30 days, though, they can be damned difficult to restore if you don't have shell access to the remote server. > it seemed to indicate you could access a deleted branch > but I didn't see how. If you have command-line access to the box on which the repo lives (i.e., if it's a local repo, or you can ssh in to the remote box), then you can run 'git reflog' which will show you every commit IDs to which the ref has ever pointed. One of them will be the one you want. > What if your repository is full of unused > branches and changesets that are taking too much disk space, can you > delete them for real or do they remain in the repository forever? They will get purged after (as I said above) 30 days. You can also purge 'em yourself, but I don't offhand know the command-line magic to do that, and most of the time there's no point, rather the same way there's no point in _really_ deleting messages from gmail: they'r not really costing you anything, and you might want them back someday. I invite you to hang out in the #git IRC channel on freenode.org; it's pretty high signal-to-noise.
