Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2013 + Git + Visual Studio Online + multiple Repos in one project

I have VS 2013 installed and linked up to a project in Visual Studio Team Services using git. It's all working beautifully.

Now i want to add another solution to the Team Services project in a separate repo. Team Services allows you to create multiple repos under one project but VS 2013 will only show Team Services work items about the repo which matches the project.

I could create multiple projects in Team Services, but i wanted to have one project with multiple repos in it. We can work with the additional repos within the project but linking them to work items is so painful no one will do it.

Are there any third party tool which will help my developers link commits to work items for the additional repos within the project?

Also as a side question does anyone know of any settings to require someone to link the commit to a work item?

Thank you

like image 963
Andrew Newland Avatar asked Feb 11 '14 17:02

Andrew Newland


People also ask

How do I create multiple repositories in one project?

It is a combination of two Git tools that you can use to manage multiple repositories within one project. The two tools are HelixTeamHub and Helix4Git Do. Here, HelixTeamHub lets you work with multiple repositories, whereas the developers can use Helix4Git to contribute to the sub-projects or repositories.

How do I manage multiple Git repositories with Vscode?

Rather than opening the root directory of your project you can open the first separate git repo then add others using File->Add Folder to Workspace. Once you've added them all you can do File->Save Workspace As to save your new workspace configuration. Save this answer.

Can a Git project have multiple repositories?

If you already have a solution with projects hosted on different Git repositories, just open your solution using Visual Studio's Start Window or using File > Open > Project/Solution and Visual Studio will automatically activate up to 10 repositories at the same time.

How do I add multiple repositories in Vscode?

Step 1: Clone one of the repositories (say repo1). Step 2: Create another remote in this clone which points to repo2-our second repository. Step 3: Fetch content from repo2 into this remote. Step 4: From remote to a local branch.


2 Answers

Swapping between different Repo's in VS2013 should be nothing more than a click on the "Connect" icon at the top of Team Explorer:

If Repos do not appear here, click Refresh.

Team Exporer

As you can see in my example, I have 3 git repos and 2 team projects (Test Agile is TFVC).

The second on "D" is my current one, and I only need to click "C" or "T" to change. The section in the middle is unrelated, but at the bottom you can also see my other local repos, not part of VS Team Services.

As for requiring a linked work item on check in, this is not possible in Git with Team Services, it is with TFVC. But think about how Git works, you are supposed to make many small local commits before you "push". People can re-base and squash commits before pushing for example, what would you do then?

like image 129
DaveShaw Avatar answered Nov 15 '22 19:11

DaveShaw


Work items in Team Explorer are shown for the Team Project you are connected to, not the git repository that is currently 'active'.

Also work items are unique across a Team Project Collection so it's possible to link a commit to any work item in any team project you have access to.

To link a commit to a work item, just prefix the work item id with a hash in the commit message (e.g. #1234). Once you push to the Team Services git repository it will scan the commit message and establish the link.

If you forget to mention the work item number, you can always link it up manually via the web interface See How to link a work load item with a commited change? for more information.

like image 28
Richard Banks Avatar answered Nov 15 '22 21:11

Richard Banks