You can delete the branch, but tag it first, so that it's history doesn't disappear. This way, the branch doesn't show up in the branch list, which should hopefully deter people from working on it, but the work won't be permanently erased (even after garbage collection is run).
While on master
or some other branch:
git tag foo-dead-end foo
git branch -D foo
This creates a tag named foo-dead-end
from the foo
branch before deleting foo
. You can also add a message to the tag, that explains what is in the branch, why it existed, why it's now a dead end, etc.
git tag -m 'Foo is deprecated in favor of bar' foo-dead-end foo
This is perhaps an advantage of tagging dead branches versus moving them to an alternate namespace. Although you could even do both (tag branches and then move them) if you really wanted.