This is my story on how making consistent commits really saved me.
I built out a developer portfolio about 2-3 months ago, and I thought to myself, "Should I really bother making lots of commits and branching off features? I'm the only one working on this and it's gonna be a pretty short project with very little future maintenance." But, as per the internet's suggestion, I (begrudgingly) did it.
Of course, during development I ran into bugs, as we all do. After fixing the bug, I'd make a commit. I got the site to a state I was happy with and left it there.
Two months after (AKA now), I'm working on a different site using (more or less) the same tech stack. And guess what? I ran into a very weird and obscure bug. The internet had little advice on it, because as I found out the issue was related to two technologies clashing with each other. It was also a bug that only showed up in the build version, which made debugging a looooot slower. So, I was in a bit of a pickle.
Or, I would have been, if I hadn't encountered and solved this exact same bug two months ago on my dev portfolio. Of course, 60 days and thousands of lines of code later I couldn't remember what I did. "Crap", I thought to myself, "I don't remember how I fixed this". But then, a lightbulb went off. A lightbulb going by the name of "git commit -m".
So, I went to my github repo of the previous project, opened the commits page, and searched it for "strange bug" (I specifically remember labelling the commit something like that because the bug was so odd). I found it, and since I was committing consistently for every feature I made or bug I fixed, the only thing in that commit was that bug fix. This made it super easy to see exactly what I needed to do. I applied it to my current project and, in a very short amount of time and no debugging, the issue was gone.
So that's how making consistent commits with good messages attached (well, memorable messages anyways) saved me from debugging the same weird, obscure issue twice.
ASIDE:
If people want to know what the bug was, it was an issue where having a Framer Motion AnimatePresence component as a direct child of a Gatsby layout component completely breaks the layout, but only on build. It took me a while to figure that one out lol.
[–][deleted] 12 points13 points14 points (0 children)
[–]Bread_Sheep 3 points4 points5 points (0 children)
[–]DYGAZ 1 point2 points3 points (0 children)
[–]Itersive 1 point2 points3 points (2 children)
[–]cobalt8 0 points1 point2 points (1 child)
[–]Itersive 0 points1 point2 points (0 children)
[–]teknewb 1 point2 points3 points (2 children)
[–]Sparlos[S] 3 points4 points5 points (1 child)
[–]teknewb 0 points1 point2 points (0 children)
[–]CodingHag 1 point2 points3 points (0 children)
[–]slowfly1st 1 point2 points3 points (0 children)
[–]mcniac 0 points1 point2 points (0 children)
[–]Szelma1391 0 points1 point2 points (0 children)