1

I have created a project with structure as follows:

jQuery  
 - Timepicker  
 - Datepicker  
 - ScrollEvent  

I have one project named jQueryUtils which has 3 sub-modules within it and I should be able to checkout each of them seperately and work on it independently and track changes/commits done on each submodule.
I found a link which explains about GIT Submodules feature.
But the only issue is that each submodule should again point to an existing repo.

Is there any way we can checkout and work on each sub-module without actually creating seperate repo's for each sub-module.
i.e. Currently I can create 'n' number of modules in 'n' different repositories and then merge them into one project using GIT submodule feature,
But what I want is create 1 project in 1 repo with 'n' modules and then work on each of them individually and track all changes on each module.

Abhishek
  • 1,999
  • 5
  • 26
  • 52
  • *Is there any way we can checkout and work on each sub-module without actually creating seperate repo's for each sub-module* – why do you want that? Modularizing the things as much as possible is a good thing. – Ionică Bizău Oct 12 '15 at 06:06
  • Yes, but that would mean I need to again create multiple repositories and maintain each one of them. What I was expecting is one repo which has everything modularized within it – Abhishek Oct 12 '15 at 06:08
  • Creating and maintaining multiple little projects is much easier than having a big repository which contain all the code, even it's modularized inside. You can add local submodules (local repositories), but then, they will not be accessible on GitHub. – Ionică Bizău Oct 12 '15 at 06:26

1 Answers1

1

If you want to push the project on GitHub, the correct way to do this is using submodules pointing to other repositories from GitHub (or other similar service).

You can add submodules with a local remote, but they will not be accessible on GitHub, since they point to a local directory on your machine.

Like I mentioned in comments, creating repositories for each submodule is not a problem and it's not so hard to maintain as you expect.

See Nested git repositories without remotes (a.k.a. git submodule without remotes)

Community
  • 1
  • 1
Ionică Bizău
  • 109,027
  • 88
  • 289
  • 474