Reputation: 26280
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:
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.
Upvotes: 30
Views: 80051
Reputation: 4031
Now its simple to Use GitLab with Visual studio 2015 just add GitLab Extensions to Visual studio and you are there.
Upvotes: 7
Reputation: 179
For using gitlab when you have ssh keys and also your ssh key have passphrase, you have to follow instructions as follow (don’t forget to upload your public key to gitlab)(also you must use a private key which its format is openssh):
git config --global user.name "your-name"
git config --global user.email "your-email-address"
git init
ssh-agent bash -c 'ssh-add “private-key-local-address”; git remote
add origin “online-repo-address”’
(will be asked for passphrase)git add .
git commit -m “initial commit”
ssh-agent bash -c 'ssh-add “private-key-local-address”; git push
-u origin master'
(will be asked for passphrase)For further commits, you can commit changes in visual studio (ONLY COMMIT) and then repeat step 10 to push them to gitlab servers.
edit: for send a project from visual studio to gitlab use git remote add origin
and for get project from gitlab to visual studio use git clone
instead!
Upvotes: 2
Reputation: 26280
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":
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.
Upvotes: 26