The Internet at large also has arguments against them. I already have written some guidelines and tips about them and also explored alternatives. They won't necessarily save you from slow build times, though. Submodules can be convenient, especially for dynamic languages. If you can't or don't want to use a dependency tool, git has a facility to handle submodules. A perfect solution to the problem is far from here. ![]() In some setups (like ours) updating APIs requires a milestone release of the product, and then the plugin, and then the product again We've probably missed a few things, but you get the idea.Refactoring when not all the source is available in a single repository.Hinders the discoverability of repositories.It requires manually setting up new builds for each component.Takes time and can fail for lots of stupid reasons.Making a change to a component requires a release.Splitting components into separate repositories comes with some serious pain. Basically I think most people need to worry about build times at some point, which is why you should use a dependency management tool. This by the way means submodules (see below) lend themselves very well to dynamic languages for example. But as the project grows, that may result in your build to be too slow – at which point you need "caching," which is where dependency management comes in. Simplistically at the start of a project everything is packed in one build. Some of these tools have limitations and make assumptions that are not optimal, but are proven and viable. At build time the tool of choice will pull the right versions of the dependencies so that your main project can be built. In Go the build/dependency infrastructure is somewhat built into the language (though people have been working on a more complete solution, see godep) For our Git server Bitbucket Server we use both Maven and Bower.Ivy (or some custom CMake action) for C++ (Updated!).Pip and requirements.txt if you use Python.Bower, Component.io, etc if you use Javascript (Updated!).There is one for (almost) every technology stack out there. Keep your modules separated in individual repositories and manage their interdependency using a tool built for the job. First choice: Use an appropriate build/dependency tool instead of gitĪ dependency management tool is my current recommended way forward to handle the growing pains and the build times of sizeable projects. So the following are just guidelines so that you can devise your own approach. Once a project grows over a certain size, it makes sense to split it in logical components, but don't wait to have a 100 million plus lines of code in a single repository before you do. ![]() Please realize that there is no silver bullet – in git or otherwise – that will painlessly solve all the issues related with project dependencies. Jokes aside, let me answer with broad strokes first and dig deeper afterwards. So back to the question: How do you track and manage project dependencies with git? ![]() Painting with broad strokes: guidelines and sub-optimal solutions But it's a relatively natural – sometimes mandatory – step in the evolution of a software project for at least two major reasons: increasing build times, and shared dependencies between projects. ![]() Having separate repositories as opposed to having a single one can make some things harder. Obviously project dependencies and build infrastructure are two intertwined areas, and even internally at Atlassian a discussion sparked on the "Future of Builds". The topic appears to be a big pain point for many software teams adopting git, so in this article I'll try to shed some light on the issue. What's the best way to handle those with git? How do you split a very big repository in smaller components using git? These are some examples of the most asked questions we got at the European leg of our recent Getting Git Right tour. Currently we manage those with svn:externals. How do you handle project dependencies with git? Our project is made up of multiple inter-dependent repositories.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |