You can split code management into two tasks:
Reducing complexity
Increasing confidence
——
And you do both over a continuous process.
How to increase confidence?
Minimize the ways things can be done
Make those ways obvious
Make sure those ways work
Automate anything you can
Introduce explicit processes for anything you can’t automate
Leave notes for things where you can do neither
Ensure the new code you add is better than the old one (through automation, process, and notes)
https://klinger.io/post/613532774806192128/how-i-think-about-code-management