1

I have a directory that looks like this:

ProjectFolder/
  + project_file

  + project_file_2

  + project_folder/
      + another_file

  * my_stuff/       <= add to repo
      * foo         <= add to repo
      * bar         <= add to repo

  * my_file         <= add to repo
  * my_other_file   <= add to repo

ProjectFolder is a piece of software that I did no write, nor is it a git repository. For what it's worth, it's vBulletin.

Inside the main folder, I have some project extensions/modules/etc. The location of these files is mandated by the outer project. Luckily, 95% of the files I care about stem from the ProjectFolder root. (Note the files marked with * above)

Is there a way I can easily add the *-marked files to a git repo?

The issue I see here is that git won't be able to distinguish my extensions from the outer project.

Extra: When updating the outer project, it would be nice to simply reclone the git repo to reinstall all the extensions in my git repo.

maček
  • 76,434
  • 37
  • 167
  • 198

1 Answers1

1

Repo within a repo means generally submodule.

If you can make ProjectFolder a "parent repo" and each of your subdirectory a submodule, you would achieve the kind of organization you are after.

Each subrepo could be changed independently one from another.
Even if ProjectFolder is not a repository, nothing prevent you to make one in it (git init .), and you could add in it directly my_file and my_other_file, plus the reference to the other subdirectories declared as repo of their own.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • the outer project is not a git repository. Updates for the ParentProject are not version controlled. The come in the form of a `.zip` file. – maček Oct 04 '10 at 17:41
  • 1
    @macek, but if you make a repo from `ParentProject`, you can then unzip directly in it and see in the various submodules the changes introduced by that zip: you would then commit those changes in each submodules before committing in the Parent repo (`ParentProject` folder) – VonC Oct 04 '10 at 17:44