In Git from the Bottom Up John Wiegley suggest running a cronjob throughout the day that calls git stash followed by git stash apply. I appreciate the idea of having hourly (or even more frequent) snapshots of my work, but I'm afraid that the build could break if a file momentarily disappears or reverts to HEAD. Is there another way to accomplish the objective, without running this risk?
You could do something like:
git branch -f autosave $(git stash create)
This will force the branch autosave
to update to a newly updated stash object. git stash create
saves but doesn't touch your index and working tree. You can rely on the reflog of autosave
to find previous versions just like stash does.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With