I'm a _very_ big believer in maintaining an informative Git history. I have some suggestions for practical Git usage patterns in a blog post I wrote last year:
If you see Git as a dumb sharing tool you are correct. It’s also correct to see it as a Global Information Tracker (git) whereby you are able to share the functional state of a program. Let’s say you make a commit of a program and tag it with a version, and also leave a message to yourself which explains what that commit or version accomplishes. By doing so, you’re going beyond “saving the text” and into “saving the state” which is valuable!
https://blog.isquaredsoftware.com/2021/01/coding-career-git-...
TL/DR for that section:
- Write Good Commit Messages
- Make Small, Focused Commits
- Clean Up Commit History Before Pushing
- Only Rewrite Unpushed History
- Keep Feature Branches Short-Lived
followed by some thoughts on "Git Archeology" as a useful concept.