Git submodule URL not including username?

If I understand correctly, you’re using HTTP basic authentication over HTTPS to allow only particular developers to access the repository. In that case, you can commit a .gitmodules that looks like: [submodule foo] path = sub/foo url = https://example.com/git/foo.git … i.e. without a user name, and then tell each developer to put their username and … Read more

Git submodules and ssh access

If possible, it’s best to make sure that the .gitmodules file contains a URL for the repository that can be cloned by anyone, typically either a git:// or http:// URL. Then users that have SSH access themselves can change into the submodule after cloning and change the URL in remote.origin.url to point to an SSH … Read more

How do I check out a specific version of a submodule using ‘git submodule’?

Submodule repositories stay in a detached HEAD state pointing to a specific commit. Changing that commit simply involves checking out a different tag or commit then adding the change to the parent repository. $ cd submodule $ git checkout v2.0 Previous HEAD position was 5c1277e… bumped version to 2.0.5 HEAD is now at f0a0036… version … Read more

Git: track branch in submodule but commit in other submodule (possibly nested)

Update 2020: The OP BartBog reports in the comments: The current (2016) answer does not work that well (anymore?) with subsubmodules since $top/.gitmodules does not contain the branch info of the subsub (and subsubsub modules) New solution: export top=$(pwd) git submodule foreach ‘b=$(git config -f ${top}/.gitmodules submodule.${path}.branch); \ case “${b}” in \ “”) git checkout … Read more