Re: Prevent reset --hard from deleting everything if one doesn't have any commits yet

2019-03-02 Thread Junio C Hamano
Jeff King writes: > Wouldn't that mean all of the file data is available in the object > database? Unfortunately without an index, there's nothing to mark which > file was which. But `git fsck --lost-found` should copy out all of the > file content into .git/lost-found. If we had a hierachically

Re: Prevent reset --hard from deleting everything if one doesn't have any commits yet

2019-03-01 Thread Jeff King
On Fri, Mar 01, 2019 at 07:56:00AM +0100, Johannes Sixt wrote: > Am 28.02.19 um 22:43 schrieb Manuel Guilamo: > > I accidentally executed git reset —hard in a project that doesn’t > > have any commits yet. git erased everything, everything I’ve worked > > the past week, I believe this is not a des

Re: Prevent reset --hard from deleting everything if one doesn't have any commits yet

2019-03-01 Thread Manuel Guilamo
Oh yes... I did. Sigh Regardless, wouldn’t be nice to have a confirmation in cases like this? considering git isn’t only used by experts. It would’ve helped me A LOT, that’s for sure… and I’m 100% sure I won’t be that last person in the history of git that would suffer this. Thank you for you

Re: Prevent reset --hard from deleting everything if one doesn't have any commits yet

2019-02-28 Thread Johannes Sixt
Am 28.02.19 um 22:43 schrieb Manuel Guilamo: > I accidentally executed git reset —hard in a project that doesn’t > have any commits yet. git erased everything, everything I’ve worked > the past week, I believe this is not a desired behavior, considering > I’m not able to undo that action, because g