Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect Visual Studio 2015 to an existing Gitlab project?

There is an on-premise instance of gitlab installed. There are Visual Studio projects in this instance. What is the easiest way of connecting Visual Studio 2015 to one of the projects?

With GitHub, you can do it by selecting "Connect to GitHub" as on the following picture: enter image description here

and then pasting the repository url. There is no GitLab option in the drop down. What is the easiest way of configuring Visual Studio 2015 to work with a solution from gitlab repository? By work I mean to have your usual source control bindings to the repository.

Note, that this question is probably useful in more general context of connecting to any git repository that is not GitHub, and does not have direct support with built-in Visual Studio menu, not just to GitLab repository.

like image 762
Andrew Savinykh Avatar asked Feb 03 '16 01:02

Andrew Savinykh


People also ask

How do I add an existing project to Visual Studio in Git?

Just right click on your solution and select Add to source control. Then select Git. Now your projects has been added to a local source control. Right click on one of your files and select Commit.

How does GitLab connect to Visual Studio Code?

Open Visual Studio Code. Under Extensions, search for GitLab Workflow. Install the extension, then open the command palette by pressing Command + Shift + P . In the command palette, search for GitLab: Add Account and press Enter.


2 Answers

First, get the clone using command line:

git clone <repository url> 

Then in Visual Studio, in the Team Explorer pane, select the connect button and look for Local Git Repositories "tab":

enter image description here

Press Add, as indicated on the picture, and select the folder you cloned your repository too.

When the process finishes, you can double-click the added repo to "connect" to it, and then select and open a solution it contains. After that follow your usual Visual Studio git workflow.

like image 164
Andrew Savinykh Avatar answered Sep 28 '22 02:09

Andrew Savinykh


Now its simple to Use GitLab with Visual studio 2015 just add GitLab Extensions to Visual studio and you are there.

  1. Steps for Adding GitLab Extensions to Visual studio

enter image description here

  1. In Search of Extensions and updates choose online and search GitLab.

enter image description here

like image 27
Saineshwar Avatar answered Sep 28 '22 01:09

Saineshwar