I can empathize with that. here’s my opinionated guide to git. this pattern is common in large OSS projects as well as big tech:
- read up on and practice using “conventional commits”. this will help focus commits into isolated units of work
- read up on and practice using “feature branches”. this will allow you to group your tidy commits into an isolated branch. feature branches should introduce one feature/change/fix. eg “add login support” or “fix bug x”.
- submit a pull request for the feature branch
- after review is complete and changes are ready to merge, squash all the commits into a single commit, then merge. this keeps the main branch’s commit log clean and readable
this is the basic workflow I’ve followed and introduced to teams I work on. there are lots of variations at each of these steps, but it’s a good place to start.