I started pulling the common code I use in my different projects, and it's slowly becoming my own codebase, as I see is usual to do here. The problem is, I don't know how to manage it. At first I copied and pasted the code and changed it only on the project I was working on, then copied the new version to a newer project and so on, but for example some times I needed to fix bugs in the codebase for many projects, so I needed to duplicate the work for all of the affected ones. Now I use a monorepo as an umbrella, where all my projects live and share the same codebase. I generally include one header cb.h
, compile the full cb.c
and that's it. But then, when I change some API, I need to change it for all affected projects, otherwise they do not compile anymore.
What is your way of managing your codebase?