Search code examples
gitgit-submodules

How to make Git submodules easier for non-programmers?


Our small software shop recently migrated from Subversion to Git, as we programmers found Git better. The migration wasn’t painless, we’re having problems with the submodules feature. My main gripe is that once a repo contains submodules, you can’t simply clone it and expect things to work. You have to do an extra step to init and download the submodules. Subsequent pulls should update the submodules automatically, so that’s OK. But when I add a new submodule, push the commit and people pull, they don’t get the new submodule automatically, they have to git submodule update by hand, again.

This is dumb, since people can’t simply pull a repo with submodules and expect it to build. Is this understanding correct? Programmers can simply write a script or an alias to update the submodules after receiving new commits, but for our non-programmers submodules are a pain. I’d like to come up with a solution that would make the repo always work right after cloning/pulling, regardless of the Git client used.

What are my options?


Solution

  • Nowadays the submodule support is much better, making the issue almost non-existent.

    • GitBox received good submodule support.

    • SourceTree by Atlassian is a free Git client that added submodule support in 1.3. There was a small glitch in submodule handling in 1.3.1, but otherwise the client seems to cover all submodule use cases that I wanted – that is, it makes submodules practically transparent for non-programmers.

    • Git Tower also seems to support submodules very nicely since 1.4.