5 ms·
That's a bit of an overstatement. You can't have a catastrophe with stuff already committed (but it's very easy to delete in-progress work).
by tomp 10y ago
That's a bit of an overstatement. You can't have a catastrophe with stuff already committed (but it's very easy to delete in-progress work).
- guard-of-terra 10y agoOnly if you never commit and then do checkout -f / reset --hard. Why would you be doing that? Otherwise it's still in reflog. Anything you ever commited is just there.
- mnarayan01 10y agoUnreachable references will be pruned after 30 days (by default) if/when git-gc gets run (which will occasionally happen automatically by default). Not saying it's a problem, just note that they're not actually there forever.
- lomnakkus 10y agoFor reflog it's 90 days. (So anything referenced by the reflog will be retained for that long.)
- mnarayan01 10y agoAFAICT, for unreachable entries (e.g. as generated by `git commit --amend`) the default is 30 days as defined by `gc.reflogExpireUnreachable`.
- gergoerdi 10y agoNo, because those commits are still reachable from the reflog.
- duiker101 10y agoIf you are committing so rarely that you can have a CATASTROPHE with your in-progress work, maybe you should try breaking the work in smaller parts and committing more often
- lmm 10y agoUnfortunately git's staging area concept encourages you to do exactly the opposite of this.
- reitanqild 10y agoI almost only use it to cherry-pick and then immediately commit?
- lmm 10y agoRight, all the good use cases involve not actually using it - if you're immediately committing then it would be better if it just became a commit.
- reitanqild 10y agoI meant: I cherrypick from my changes and commit bugfixes and drive-by update of comments separately. My bad. I shouldn't have used the word cherrypick there.
- gpderetta 10y agowell unless you haven't pushed in a while and you rm -rf your home directory. Of course that has never happened to me. On a completely unrelated topic, extundelete is a great piece of software.