In some recent projects, I found myself having some longer spike phases in which I build many cheap prototypes and explore different design decisions, long before I would consider my code of acceptable quality. Usually, when I check in my code into git or any other VCS, I refactor and clean it at the same time, so that I can produce a meaningful ancestry with nice code. I was considering this workflow a kind of very lean development because it allows me to make many cheap experiments before having to deal with refactoring or committing labor.
However, in my latest spike phases, this led to huge working copies on my machine, and the burden to finally get all this stuff cleaned up and committed was getting large and larger. During my spike phases, I also cannot benefit from the advantages of VCS such as restoring a previous state of my work, having a backup in the cloud in case my laptop gets lost, autc. Since I do not have collaborators in these projects, there is no external pressure to integrate more often or earlier.
I wonder how I can find a trade-off between lean spiking phases on the one hand and a healthy VSC workflow on the other hand. Are there some best practices or recommendations for this problem? I already considered committing my spikey changes to an auxiliary branch that is never merged into main, but a) by this I would lose an overview of all my changes in the spike (which I at the moment can retrieve with simple git diff
resp. in the commit preview of my git client of choice) and b) I would have to spend double time on committing my changes into meaningful chunks.
Thank you in advance!