3 ms·
Technically a push does not destroy heads in git either (that requires a gc), but contrary to mercurial "detached heads" are not visible by default, you have to
by masklinn 11y ago
Technically a push does not destroy heads in git either (that requires a gc), but contrary to mercurial "detached heads" are not visible by default, you have to explicitly go and hunt for them.
- sampo 11y agoYes, you are correct. The problem is not so much with git, it is with GitHub. You cannot retrieve dangling heads from GitHub, not even by cloning. Maybe GitHub runs garbage collection right away? But if you just keep your repositories on your computers, then yes, you can clone and then find the dangling commits in the clone, too, and then save them.
- masklinn 11y ago> You cannot retrieve dangling heads from GitHub, not even by cloning. Maybe GitHub runs garbage collection right away? Nah, since you can undelete branches on github. It's just the way git works: it only retrieves (clone/fetch) named heads and whatever is reachable from there, so detached heads aren't fetchable.