top | item 7940609

(no title)

mvermaat | 11 years ago

In a way that's already true, since the commits are still there (and included when you clone). They're just not discoverable.

It would be neat though if GitHub added some UI magic to recover dangling commits, possibly using the knowledge of which branches previously pointed to them and/or push -f operations.

discuss

order

js2|11 years ago

You only get the commits reachable from the refs you clone. i.e. anything under refs/heads/* by default. Unless a commit is reachable from a ref you can fetch, it is not retrievable to you and won't be in your clone. So unless GitHub can locate it via reflog and create a ref, you won't be able to access it.

benatkin|11 years ago

Aren't these part of what gets cleaned up by git gc?

4mnt|11 years ago

Yes they are. But only after they get dropped from the reflog, after 30 days by default.

mvermaat|11 years ago

That is true, but only when they're older than 2 weeks (or whatever you define with --prune). I don't know what GitHub's configuration is here.