Git submodule on remote bare

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

Convert a Git folder to a submodule retrospectively?

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.

Set Git submodule to shallow clone & sparse checkout?

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

how exactly does git submodule work

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