[Bro-Dev] Git merge and submodules

Jonathan Siwek jsiwek at ncsa.illinois.edu
Wed Jan 12 11:10:52 PST 2011

> How I can I get rid of that. I don't really care for updating my
> submodules. The "git checkout -- aux/binpac", etc. didn't help.

If you just want to prevent it from showing something in `git status`, you can give it the --ignore-submodules options.  There's also a global git config option you can add to your ~/.gitconfig, e.g.:

[submodule "aux/binpac"]
    ignore = all

You'd have to add a section for each submodule you want to ignore, though.

> Can I do a merge without getting the submodules as well?

Just to be sure we're understanding what happened, can you check if files were actually updated in the submodules?

If my understanding is right, nothing actually was updated in the submodules.  What has changed are your bro repository's submodule "pointers", which essentially track a specific version (commit) of a foreign repository so that you'd checkout that version when you explicitly do a `git submodule update`.

If this is the case, I'd recommend just taking the "ignore" approach I described above.
> Alternatively, I guess I can just accept the changes to the submodules.
> Can I just do a "git commit -a" ?

That's another option, but I don't think I like it because it pollutes the commit history with a bunch of "updating submodule" type commits and I think it might also lead to the repository maintainer having to reset submodules again upon merging your branch.

> However, git status still tells that I'm ahead by 7 commits?
> Why? I can see that I'm ahead by 1 commit, namely the merge commit....

Sorry, don't have any good idea about why that is.  Maybe compare with a fresh clone of the repository.

- Jon

More information about the bro-dev mailing list