Git submodule push

A submodule is nothing but a clone of a git repo within another repo with some extra meta data (gitlink tree entry, .gitmodules file ) $ cd your_submodule $ git checkout master <hack,edit> $ git commit -a -m “commit in submodule” $ git push $ cd .. $ git add your_submodule $ git commit -m … Read more

Two git repositories in one directory?

This article covers this relatively well: https://github.com/rrrene/gitscm-next/blob/master/app/views/blog/progit/2010-04-11-environment.markdown Basically if you’re working from the command-line this is simpler than you might guess. Suppose you want 2 git repos: .gitone .gittwo You could set them up like so: git init . mv .git .gitone git init . mv .git .gittwo You could add a file and commit … Read more

How to make shallow git submodules?

New in the upcoming git1.8.4 (July 2013): “git submodule update” can optionally clone the submodule repositories shallowly. (And git 2.10 Q3 2016 allows to record that with git config -f .gitmodules submodule.<name>.shallow true. See the end of this answer) See commit 275cd184d52b5b81cb89e4ec33e540fb2ae61c1f: Add the –depth option to the add and update commands of “git submodule”, … Read more

Why are git submodules incompatible with svn externals?

The fundamental difference is the composition rule. In a true component-based approach, you define a configuration, that is: The list of labels (of SHA1 commits for Git) you need for your project to “work” (i.e. “develop”, “compile”, “deploy”, …). Each commit referenced in a configuration helps you to get the exact versions of all trees. … Read more

How do I work with a git repository within another repository?

The key is git submodules. Start reading the Submodules chapter of the Git Community Book or of the Users Manual Say you have repository PROJECT1, PROJECT2, and MEDIA… cd /path/to/PROJECT1 git submodule add ssh://path.to.repo/MEDIA git commit -m “Added Media submodule” Repeat on the other repo… Now, the cool thing is, that any time you commit … Read more

Why is my Git Submodule HEAD detached from master?

EDIT: See @Simba Answer for valid solution submodule.<name>.update is what you want to change, see the docs – default checkout submodule.<name>.branch specify remote branch to be tracked – default master OLD ANSWER: Personally I hate answers here which direct to external links which may stop working over time and check my answer here (Unless question … Read more

How to un-submodule a Git submodule?

If all you want is to put your submodule code into the main repository, you just need to remove the submodule and re-add the files into the main repo: git rm –cached submodule_path # delete reference to submodule HEAD (no trailing slash) git rm .gitmodules # if you have more than one submodules, # you … Read more