Git submodule inside of a submodule (nested submodules)
As mentioned in Retrospectively add –recursive to a git repo git submodule update –init –recursive should work.
As mentioned in Retrospectively add –recursive to a git repo git submodule update –init –recursive should work.
I’m afraid there’s not enough information in your question to be certain about what’s going on, since you haven’t replied to my follow-up question, but this may be of help in any case. That error means that projectfolder is already staged (“already exists in the index”). To find out what’s going on here, try to … Read more
Submodules are always checked out in a detached HEAD mode. That is because a submodule will checkout the SHA1 stored in the special entry in the index of the parent repo. Plus, if you want a submodule to follow the branch you have registered in the .gitmodules, you need: git submodule update –init –remote The … Read more
I figured out another solution which looks rather clean to me. Just give git all the info it needs to perform the submodule stuff: $ cd /path/to/your/git_work_tree $ git –git-dir=/path/to/your/bare_repo.git –work-tree=. submodule init $ git –git-dir=/path/to/your/bare_repo.git –work-tree=. submodule update
To isolate a subdirectory into its own repository, use filter-branch on a clone of the original repository: git clone <your_project> <your_submodule> cd <your_submodule> git filter-branch –subdirectory-filter ‘path/to/your/submodule’ –prune-empty — –all It’s then nothing more than deleting your original directory and adding the submodule to your parent project.
Setting up shared dependencies as submodules is easy. The git submodule command doesn’t do it automatically, but a submodule is nothing more than a nested repository — and git doesn’t require any actual repository or its worktree to be in any particular place. Set up a libraryXYZ repo for use as a shared submodule # … Read more
There is even a possibility to set the ignore mode for every added submodule within the .gitmodules file. Just today I encountered this problem and immediately wrote an article in my blog about it after finding a solution: How to ignore changes in git submodules The gist of it: Once you added a submodule there … Read more
You have a project — call it MyWebApp that already has a github repo You want to use the jquery repository in your project You want to pull the jquery repo into your project as a submodule. Submodules are really, really easy to reference and use. Assuming you already have MyWebApp set up as a … Read more
With git1.8.4 (July 2013), in addition git shallow update for submodule (git submodule update –depth 1), you now can have a custom update: In addition to the choice from “rebase, merge, or checkout-detach”, “submodule update” can allow a custom command to be used in to update the working tree of submodules via the “submodule.*.update” configuration … Read more
Your submodule is represented as a special entry with a special mode (called a gitlink, see “Nested git repositories without submodules?“): (See “Checkout past git submodule commit“) new file mode 160000 index 0000000..4c4c5a2 So it isn’t checking out the “LATEST” version, but always a specific SHA1, and it does so in a DETACHED HEAD mode … Read more