Hacker News new | past | comments | ask | show | jobs | submit login

You should change the way you work with git. Commits are cheap. Really, really cheap. Commit all the time. Make "WIP" commits to remind you to squash them later. Your working directory is just like any other place on your filesystem. You can lose stuff if you do the wrong thing.



Yes, I do do this. But Dropbox is still a good safety fallback. I'm not committing everything for every line of code, but with VS Code auto-save, Dropbox is basically committing a version for every line of code.

It's useful even if I just refactor some code and change part of the refactor and then change my mind and want to go back to what I was initially trying. And it also helps if my hard drive dies or my laptop gets stolen, etc.


> Your working directory is just like any other place on your filesystem. You can lose stuff if you do the wrong thing.

Which means git is failing to do its whole job: keep the history of my work safe. I'd argue that git actually makes data on your filesystem less safe, because it pointlessly write-protects files in the .git directory, which encourages a bad habit of using rm -rf.


I've not once lost work in 15 years of using git. A bad workman always blames his tools.


A defender of a flawed tool always blames the user. (Steve Jobs's "you're holding it wrong".)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: