It’s a Night When I Want to Run git reset --hard

All my commit messages are piled up like 'fix', 'real fix', 'ugh, why isn’t this working'—I just want to wipe them all out.

by 뉴비탈출646

5 answers

Hahaha, 'real edit' is the unwritten rule... I go with 'edit2', 'edit2_real'.

by 밤샘코더376 · ▲0

If you've already pushed, git reset --hard is genuinely dangerous. If you've only piled up commits locally, you can just nuke them, but if the commits are already on the remote, it's safer to squash them with rebase -i. I once did a reset to clean up messages and got tangled up with a teammate, losing half a day. If you know git reflog, you can recover them, but even knowing that, it still makes your heart drop. Just start splitting commits into smaller units and make a message template for yourself now. If you set commit.template, it still won't make you 'edit' anything unless you enforce it with a hook lol.

by 카페인중독645 · ▲0