submodule

How do I remove a git submodule?

The title says it all: how do I remove a git submodule? And by the way, is there a reason I can't simply git submodule rm whatever? ...

Another use-case of splitting a git project into several subprojects.

I have split my project into several subprojects But all have a common part (directory with cmake scripts). Moreover some subproject need to include other subprojects (libraries). I would prefer to use git submodules but as far as I know they have a limitation that a submodule needs to be in a separate directory in the repo (does it?) w...

How to track config files of submodules in Git?

In Git, how can I organize work to track local config files of a library, which is a git submodule? In details: the library has normal files that are tracked, and default config files that are in it's folder, but not tracked, in order to avoid resetting or overwriting them (they're listed in .gitignore). All the files are in lib's fold...

What is the advantage of using git submodules over having a repo inside another repo with a gitignore?

We've been looking into git submodules and we are wondering what advantage (if any) is there in having a repository using submodules verses having a repository within another repository with a .gitignore file. Example without submodules: mkdir a cd a git init touch test1.txt echo "b" > .gitignore git add . git commit -m "Adding test1.t...

How to "freeze" git submodule

I'm using a few repository which I do not host myself and I thinking what if I deploy my application while they are not available? This simply just can't happen. Is there a way to "freeze" the submodule somehow that when I pull from my repository the submodules are already init and update? Any help is appreciated. ...

How to make part of an existing GIT repository a submodule

I have this git repository which contains to folders binary-search and poker: http://github.com/soulnafein/code-katas I would like to make this folders two submodules and I would like to keep the change history. How can I do that? ...

git submodule error

Getting this error: fatal: cannot read object aab1ca8db3ab8f1508db42220f9badc7b62dd4aa 'vendor/plugins/simple_stuff': It is a submodule! When doing git pull from the main repo. I don't have any submodule defined any where inside my project, still I have another repo inside vendor/plugins/simple_stuff. Any ideas? ...

un-submodule a git submodule

How do I un-submodule a git submodule (bring all the code back into the core) ? As in how "should" I, as in "Best procedure" ... ...

GIT submodule fatal: cannot describe

I am trying to add a git submodule to my project, but git keep telling me $ git submodule fatal: cannot describe 'dd650e8bb4762a8a7f69a6412b4765c9bb108778' What means "fatal: cannot describe" and how can i avoid this? ...

Why is git submodule update not automatic?

When switching branches with git checkout I would assume that most of the time you would want to update your submodules. In what situation do you not want to update submodules after switching? What would break if this was done automatically by git checkout? Updated with example: Branch A has submodule S at 3852f1 Branch B has submo...

Git Submodules: Is it possible to have more than one URL for each?

I was wondering if it is possible to have more than one URL for each git submodule. It would be interested to have more than one source of it if one of them is down or someone is behind a proxy that blocks one of them. Have you ever had this problem? How would you solve it? ...

create a git repo for project skeleton

Hi all I created a custom project skeleton as a start for my django projects, hosted on a public repo at github. Id like to use this as root folder for my new, public and privates projects, also hosted @github. The problem is i cannot use this one as a submodule because as fas ar i know i cannot add submodules inside another submodule...

How to update a submodule in git to the HEAD commit in that external repo

I had problems finding the answer to this so I am posting it for posterity. The situation is, you have a git repo with a submodule (similar to an svn external). You want to update that reference to point to a different commit in the external repository. You might think 'git submodule sync' or 'git submodule update' would do that - you...

Proper git submodule links

Because I don't want to spend +$12 for the simple-to-use github.com private hosting, I place a lot of my code libraries in small repositories on a shared hosting account. This allows me to have as many code repos as I want. Since those repos don't take any resources to sit there I also put a couple very light sites on that account to ma...

How can I do git checkout on a repository with submodules?

Suppose I have a repository X with a sub module A. Now suppose I want X to have two branches: master and development. I want master to have a different revision of A than development does. How can I switch back and forth between these branches? I've got a repository set up that does this (but using real names instead of fake ones!)....

Sharing Models between two Rails Projects - using git submodules?

I have a Rails website which has been divided into two separate projects - the public site, and the administration site. As both sites are using the same database the models are shared between the applications (actually right now they are duplicated). The problem I have here is that when an update to the models occurs in the public proj...

Why does Python's __import__ require fromlist?

In Python, if you want to programmatically import a module, you can do: module = __import__('module_name') If you want to import a submodule, you would think it would be a simple matter of: module = __import__('module_name.submodule') Of course, this doesn't work; you just get module_name again. You have to do: module = __import__...

git submodule, ignoring the wrong directory

I am new to git but have spent a good deal of time reading through documentation and gotchas on git submodules before trying them. I am having a problem that I feel -- probably naively -- is a bug in git: I have a project, in that root directory I have a plugins folder, which has a submodule called myplugin. I added it with git subm...

How can I add a specific folder from a git repo as a git submodule?

I have a git repo and I want to add a submodule to it. Problem is, the submodule exists as a folder inside another repo. Can I add only that folder as a submodule? ...

Is it possible to have a subversion repository as a "submodule" in git?

Hi Is it possible to have a subversion repository as a "submodule" in git? In this project we will have several parts, but some parts will use svn and some will use git. So I am looking into a "project root" from where we can have the other projects as submodules (or similar). And the question is if it is possible manage this "project...