Comment by globular-toast

Comment by globular-toast 2 days ago

0 replies

The one thing I wish people would internalise about git is it's an append only data store. To get work into the store, you commit it. Once in the store there is not a command in git that can remove it.

This is how the reflog works. Whatever you do, you can get back to a previous branch state and restore the work from the data store.

But git can't help you if you don't commit. So just commit. Commit all the time. If you think it's too much overhead and you always forget to commit, fix your tools. If you're writing code all day you should be committing at a minimum every hour, in general.