sheepsqueezers
sheepsqueezers

Reputation: 89

Git Repository in Team Foundation Server - Create Sub-Repository?

newbie to TFS and Git here...sorry for the (potentially) silly question!!

My Team Foundation Server (Version 15.117.26714.0) Administrator set up a Git repository for my team and it works great! (I can even access our TFS website! Sweeet!)

But, rather than have all of the programmers store code in the SAME "main" repository, is it possible to create a "sub-repositories under the main repository" or "folders under the main repository" so that I can keep everything neat and organized...and no one ever has to download the full repository? Or is it a matter of just creating more repositories not under the "main" repository?

Just being a neat freak here!

Thanks in advance for any help/pointers!!

Upvotes: 0

Views: 712

Answers (2)

Andy Li-MSFT
Andy Li-MSFT

Reputation: 30412

You can try below ways:

  • Use submodules as Daniel said. Refer to this article for details : One TFS Build, Multiple Git Repositories with Submodules
  • Create more repositories to keep everything neat and organized.
  • Create multiple branches within a Git repository (Delete unneeded files in each branches, then publish the proper files to each of them for management.)

Thus, you can select the specific repository/branch to download as needed.

Upvotes: 1

Daniel Mann
Daniel Mann

Reputation: 59037

In general, a Git repo should be self-contained. One repo = one application.

If sharing code or other resources across repositories becomes necessary, you can use submodules to store a "pointer" to another repository. However, submodules are generally a pain to manage. You definitely don't want to have one "Main" repo with a ton of submodules pointing to other repositories.

I'd recommend starting with the least amount of complexity. You can always split a monorepo up into multiple smaller repos down the line.

Upvotes: 2

Related Questions