Re:How to end up with 500k commits in your log
by piva00 on Monday June 21, 2021 @11:26AM
(#27580084)
Do you use `git stash`? I don't understand your workflow, do you commit to keep a log of your whole line of thought? As in: with your mistakes or failed designs/approaches being backtracked (overwritten/removed, etc.) and keeping an immutable sequence of your line of reasoning?
For me, commits of work in progress are only done on my development branches before I want to push to a remote to save my work in case of my computer failing (or getting lost/stolen, whatever force majeure), I usually write a "WIP: <what's been worked on>" message that I will squash later on when I have a meaningful commit.
Re:How to end up with 500k commits in your log
by zatarc on Monday June 21, 2021 @01:29PM
(#27581406)
Just use (feature-)branches.
You can commit every single character if you in the mood. At the end, when your new feature is complete, you just squash all commits in this branch to one single commit ("add feature xyz") and merge/rebase it to your main dev branch.
Now it is really easy to identify the actual code behind a new feature.
At some point I got addicted to the number, so from time to time I try to manually increase my frequency of commits.
All that said, I end up doing more commits when working on front end stuff, when I doing back end programming, I am not at all interested in saving / committing frequently as I’m focused on the task at hand. With front end stuff, you necessarily need to save and refresh the webpage in your development browser, so it goes hand in hand with increasing my commits :-)