Using multiple Git repositories in a single Team Foundation Server project

I’ve started using Team Foundation Service 2012 (The cloud based offering) now that they have announced support for using Git as a source control solution.

My initial test was a single projected with a single Git repository named after the project.

  • How to undo file deletions from a historical commit?
  • Accidentally shared .git folder
  • Cloning GIT repository by ANT
  • Search for particular commits
  • Why is git slow on my windows machine?
  • Remove Merged Branches from Github
  • Everything went well, I could clone the repo, commit push and pull from within Visual Studio 2012 and more importantly the work item association worked as well.

    For the real project however, it made more sense to split the codebase across multiple Git repos in the TFS project.

    There was no obstruction in doing this, the interface for Team Foundation Service supported it quite nicely….

    BUT

    Now I find that in Visual Studio 2012 there are a few issues and I wonder if I’ve either done something wrong, or if its just something that is not fully supported (yet?)

    • After testing, I’ve found that if the Git repo does not have the same name as the project then you lose the ability to clone the repo easily. The default URL that comes up always assumes the Git repo is named after the projected.
    • Likewise, when the repo does not have the same name, you completely lose the ability to associate work items with commits. It also displays “(Local)” after the Git repo name, as if it has no idea that its actually associated with the TFS Project at all.

    Anyone else find this and perhaps a solution (while still allowing multiple Git repos under the same TFS Project) ?

    UPDATE:
    Found a few links such as these two

    http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/3811952-allow-multiple-git-repositories-in-a-single-team-p

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/dff9c737-fbd1-4ca8-9c32-3be14eb614ba/what-is-the-best-team-project-setup-for-using-git-with-tfs

    So at least one other person has bumped into it.

    The multiple repo’s work fine if you use Git to push remotely to the correct repo URL, it only breaks down if you use the Visual Studio 2012 integration in terms of work item association and cloning the repo.

  • Git “remembers” old not-ignored files
  • Change local branch to a different one
  • Why is a machine's ssh key required to clone a public Git repository?
  • Lost a git commit
  • How to get msysgit to clone a repository where I want it to go?
  • git rebase - difference between rebasing against develop and origin/develop?
  • 2 Solutions collect form web for “Using multiple Git repositories in a single Team Foundation Server project”

    This is a limitation of the Visual Studio Tools for Git extension that is available for Visual Studio 2012.

    enter image description here

    This problem does not exist in the Git tools that come as part of Visual Studio 2013.

    Make sure when you Connect>ManageConnections>
    that you click on the repo (under the project) rather than just the project.

    For a project with just one repo in, VS works it out.

    Git Baby is a git and github fan, let's start git clone.