Visual Studio 2015 with Bitbucket repo

Written by employee #33. Posted in just going through the motions

Using Visual Studio 2015 Community (14 update 3) with remote repo on Bitbucket (not github)

Not an expert on this, just need a Bitbucket repo for VS. Based on http://stackoverflow.com/questions/18836351/visual-studio-2013-and-bitbucket

1) Create new repository on Bitbucket (Repositories → Create repository). It is absolutely free.

New Bitbucket repo

2) Repo type must be 'Git'. Choose a meaningful name and click “Create repository”. You can do a private or public repo.

3) Make a note of the new repo URL. Should be something like this:

https://bitbucket.org/[Bitbucket User name]/[Project name]

4) Create a new project in VS 2015. Not sure if all types of projects will be ok. Below I use a “Blank Node.js Console Application” template (Installed > JavaScript > Windows > Node.js) and tested a few others. Add project name and (local) location (A strange feature for VS have always been, that both project and solution is given the same name).

5) In Solution Explore right click on project name and choose “Add solution to source control”. And … nothing happens in the Solution Explore. Now look in the Team Explore.

Add solution to source control

A local GIT repository have been created (with the same name as the solution).

At the bottom off the screen, GIT status is displayed (2 uncommitted charges in the solution. Still your Bitbucket repo should be empty). If you wonder why only two objects are being caught by GIT, check the “gitignore” file. Basically a list of files which are not going to be tracked by GIT. Pretty handy. If you have created a completely empty project, create a simple README.md file for the exercise.

GIT Status

If you try to commit the changes (Ctrl + Alt + F8) or simply click the small white arrow pointing up. Marked in yellow below.

Unpublished commits

(Number of unpublished commits is not number og files or anything. A commit can hide a lot of files. Start checking out the commit, before pushing)

Open Team Explore (should open automatically). Choose the option “Publish to Remote Repository”. Click the button “Publish Git repo”.

Now enter the URL of the Bitbucket repo (the one you made a note of in step 3). It should be along these lines: https://bitbucket.org/[Bitbucket User name]/[Project name]

Click “Publish”.

You will be asked to provide Bitbucket user name and password. Unpublished commit should now be zero.

Now check you your Bitbucket repo. Properly want to add a few more extensions to the gitignore file.

Add comment


Security code
Refresh