Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do the opposite. Because VSCode helpfully highlights the bits that were changed, I don't want to lose this indicator because of a commit, so I often postpone commits until I am ready to move to another part of feature. Then I use 'git add -p' to make multiple smaller commits, and finally push to remote origin. I don't treat commits as safelines, instead I try to make them logical explanations of the reasons for the changed code.

My safeguard is "undo", but I rarely need it. If I do, I just copy the contents of the file to a new one (ctrl n, ctrl a, ctrl c, ctrl tab, ctrl v) before undoing the wrong path - because any change on older version will break redo history, unfortunately.



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

Search: