Is there a way to make a git branch cease to show up when you type "git branch", but still remain reachable in the history, i.e. via gitk? I have many old branches that I want to get out of my sight, but I see no reason to delete history even of development dead-ends in a world with terabyte hard disks.
Tags might be close to what I'm looking for, but I don't want to have to name my dead ends beyond their commit message. Furthermore, I want reserve tags for especially good points in the mainline development history.
You can make up your own namespace inside refs/
, such as refs/historic/foo
, by manually using the update-ref
command (and then deleting the branch).
Some caveats of this approach:
git branch
, but they do show up in git log --decorate
and in gitk
without any extra options, and you may use git show-ref
to list all refs.ls-remote
and fetch
them by hand.However, it seems like a nice way to archive a branch, since it pops up when browsing history, can be explicitly listed, and does not clutter the branch or tag namespace.
Push the old branches to a remote repository on one of the many free Git hosting sites.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With