Hello,
I've started using submodule support in one of my projects. I was previously using my own poorman's submodule support where I kept the commit in a file, .gitmodules. Git's new submodule support is superior to this method and doesn't lose me any features over what I had so I thought I'd change.
My general comment is that it's great. I've tried to trip it up a few times, but it works exactly as one would expect. I was surprised how little I had to understand in order to make it work, I didn't even need git update-index. git-add and git-rm work fine when the directory you're adding is a git repository in itself. Lovely.
I'll report further as I come across any stumbling blocks; but here is one to get you going: (It's not a problem with git really, and the workaround is simple, I'm reporting it for your information rather than to get it fixed).
In the master branch I deleted my .gitmodules file and did $ git add submodule $ git commit -m "Chuck poorman's-submodule use gitman's-submodule"
This took over the submodule management beautifully. Now, I swapped to another branch and tried to merge the master branch:
$ git checkout somebranch $ git merge master fatal: Updating 'submodule' would lose untracked files in it Merge with strategy recursive failed.
I appreciate why this has happened - submodule, from the point of view of git - doesn't exist in that branch, but the directory always has, as that's where I've kept it as my pseudo-submodule. The fix was to do
$ mv submodule submodule.tmp $ git merge master $ rmdir submodule $ mv submodule.tmp submodule
I bring this up only because anyone who's moving from non-submodule to submodule support might run into the same problem.
In short: great stuff - this is already more facility than I had, thanks chaps.
Andy
-- Dr Andy Parkins, M Eng (hons), MIET andyparkins@gmail.com