Unable to checkout git submodule path

When doing git submodule update, git tries to checkout the commit/tree which is saved in the super project (in your example, the one with commit id dd208d4…) I think you get the error because within the submodule there no such object present. You have to make sure that it is there. Usually that means that … Read more

`–name` option doesn’t work with `git submodule add` command

Don’t conflate the path and the name of a submodule. You want to run git submodule add git@bitbucket.org:ironsand/cookbook-foo.git foo/ instead. For more details, see the git-submodule man page; the relevant git-submodule syntax here is git submodule [–name <name>] <repository> [<path>] where… <repository> is the URL of the new submodule’s origin repository. <path>, if specified, determines … Read more

git: change origin of cloned submodule

This apparently is very much dependent on the version of git you are using. If present, change the url entry in the [submodule “<dirname>”] section of the .gitmodules file. If present, change the url entry in the [submodule “<dirname>”] section of the .git/config file. Change the url in the configuration of the submodule itself. The … Read more

git submodule sync command – what is it for?

Git stores information about submodules in two places. The first is in a file called .gitmodules, which is checked in to the git repository. Changes to this file are what get propagated to other repositories. The other location is in .git/config, and it’s where git actually looks when performing most commands. So imagine you’ve worked … 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 to make an existing directory within a git repository a git submodule

Use git submodule absorbgitdirs This is what the docs state this command does: If a git directory of a submodule is inside the submodule, move the git directory of the submodule into its superprojects $GIT_DIR/modules path and then connect the git directory and its working directory by setting the core.worktree and adding a .git file … Read more