0

I have the need to maintain repositories where the working file sets are a subset of files within a folder tree, and will overlap -i.e. each repository will have files in common, but will also have files that aren't the other repositories. As an example I might have a folder tree:

  Folder/File                  Repository
  -------------------------------------------
  Folder1 
    FileA                      Repo-1  Repo-2
    FileB                      Repo-1
    FileC                              Repo-2


    Folder2
      FileD                    Repo-1  Repo-2


    Folder3
      FileE                            Repo-2

  Folder4
    FileF                              Repo-2

so I want Repo-1 to have FileA, FileB and Folder2\FileD in its working set, and Repo-2 to have FileA, FileC, Folder2\FileD , Folder3\FileE and Folder4\FileF in its working set.

This need arises because I have projects that are maintained both by myself and a client, and I don't want library files that aren't used by the client's application to be stored in the remote repository they will be pulling from - both for reasons of the unwanted baggage, and source code confidentiality.

Obviously the repository folders can't both be called .git and live in the same folder, so how do I set this up?

A solution that doesn't involve reorganizing the folder structure, or keeping duplicate copies of files, would be nice.. ;-)

rossmcm
  • 5,493
  • 10
  • 55
  • 118
  • 1
    You could do something like this https://stackoverflow.com/questions/436125/two-git-repositories-in-one-directory#answer-17313342 or use https://github.com/capr/multigit – dpcasady Sep 15 '15 at 04:02
  • Thanks @dpcasady. looks complicated, especially to a newbie to Git like myself. Also these methods seem heavily command-line-centric, whereas I quite like SourceTree. I'm wondering if the answer isn't a simple batch script around SourceTree that renames the `.git` folder out of the way and renames another one into view, so `rename .repo-1 .git`, ... `run SourceTree`, ... `rename .git .rep-1`. – rossmcm Sep 15 '15 at 04:21
  • ...and @dpcasady I've just noticed that the [post you referenced](https://stackoverflow.com/questions/436125/two-git-repositories-in-one-directory#answer-17313342) also mentions this approach (renaming the repository to be named `.git` before invoking the GUI) – rossmcm Sep 15 '15 at 05:58

0 Answers0