Ask HN: How do you stop forgetting to commit or push?
This happens to me frequently. I hack on a project at my laptop or home computer. The next day I travel to my office only to realize that I didn't commit or push any of yesterday's work. Thus to continue working on whatever I was working on I need to go home, push my changes, and then return to office. Very frustrating.
Does this happen to anyone else? How do you prevent it?
19 comments
[ 3.0 ms ] story [ 48.9 ms ] threadSo you should solve this by only working on work stuff using work devices, or, eg, ssh into your work box to do stuff from home.
Also, `tig` is a great tool to explore the git history
I love oh-my-zsh and it's plugins.
First commit - Function to do task Completed
Second commit - Added unit test
Third commit - Linter fixes
Forth commit - Fix bug
And so on.
That is, it sounds like you've only suffered mild inconvenience so far, not any real consequence (failure to meet deadline, being reprimanded by boss for not making progress, etc.). Once that happens, it is a powerful motivator not to make the same mistake again.
[0]: https://gist.github.com/iesahin/398af2556f5ae809c4b368ffc2ef...
[0]: https://github.com/jesseduffield/lazygit [1]: https://github.com/kdheepak/lazygit.nvim
Pushing is the same, except it's an extension of my "make a backup of the hard drive because it can fail at any time" learning experience. I push because that's how the backup works for a git repo (also collaboration), I backup because I got burned when a HDD failed catastrophically and I had no consistent backups.
Something fails, learn from the experience and make new habits or processes (automated or manual) to avoid those failures in the future.