News for hackers. Stuff that matters.
Re:Git Commands You Probably Do Not Need by ilyt on Monday January 23, 2023 @07:06AM (#34487876)
> … which results in either losing work sooner or later (because you don't commit often and early enough to always have something to roll back to),

You can just git add without commit. The changes will be saved to index and live till git decides to GC its files (so few months). Extracting those might be PITA (as requires playing with more arcane git commands) but you can't really lose data

git stash is also lifesaver if you need to quickly jump to branch to do something else

Lastly there is "git commit --amend" way of just incrementally changing the current commit but that requires some self-discipline (or hooks preventing your from) to not amend pushed commit and then having to fix that.

There are no comments on this comment yet.