0

I have the following:

ABC
    /Project1
    /Project2
    /Lib
       /Lib1        << Only has 72K of source code.
       /Lib2

And, well, the Projects and Libs should be in their own repositories right?

So, I would think, doing: (This is NOT intended to be correct, but an example of what I would expect to work)

git clone /OriginalGit NewGit --FilterToSubdirectory 'ABC/Lib/Lib1'

Leaving a clone with repository that a du will report as 72K, OK, maybe 144K, Heck,I'd settle for 1MB - although, Lord knows what it would actually use that space for.

I get: 1.6GB after doing the following:

git clone /OriginalGit NewGit
cd NewGit
git filter-branch --prune-empty --subdirectory-filter Lib/Lib1 master

  (I used a tool to remove the remote/source from the repository as the original will be going away when this is done)

git gc
git prune
git gc --agressive
git reset -hard
git repack -A -d

Yep, it still hangs in there at 1.6GB to hold 72K of data!

I need to do this N times, once for each project, and library. I'm currently just guessing that this would be the right way to do this with Git, because before I'd have everything in one repo and the branches wouldn't be repo-wide. - Putting a branch in Project1 creates a branch in Project2 - which makes no sense for that Project.

I'm thinking my new structure would be (each line it's own Repo):

Project1/ 
Project2/
Lib/              << Just a directory, not its own repository
    Lib1/
    Lib2/

Does that structure make sense with Git?

Traderhut Games
  • 1,222
  • 1
  • 15
  • 30

0 Answers0