Git

Managing Dependent Libraries with Git

When I'm developing something, I like to split out related functionality into modules or libraries whenever I see the opportunity, so that I can share code between projects and generally promote re-use.

Doing this presents a number of interesting challenges, one of which is how to manage changes to these shared modules.

If I have three projects using some module, I can either choose to have them all link to the same version of the module on my disk, or I can give each project its own copy.

On the face of it, linking to the same version sounds like the way to go. After all, we're sharing right? If we make a fix to the shared module, we want to get it in all projects don't we?

Well, sort of, but not really. It's how I used to do it, but not any more, and I'll explain why in a moment.

Syndicate content