Visual Studio 2013 and BitBucket

89,142

Solution 1

John's statement that "you need Team Foundation Server" to work with BitBucket is not correct.

I just published a project to BitBucket from Visual Studio 2013 (preview version). Here's how.

  • Add solution to Source Control

enter image description here

  • Commit to local Git

enter image description here

  • In the "Changes" area, click "Commits". This takes you to the dialog where you can publish to a Remote Repository.

enter image description here

  • Enter the URL to your BitBucket repository (must already exist in BitBucket and must be empty) and click "Publish"

enter image description here

  • Enter your BitBucket credentials when prompted. After the publish finishes you'll get a results message like this.

enter image description here

  • Use the "Sync" button to update BitBucket with your local commits

enter image description here

Solution 2

Well, it's actually pretty easy to use GIT on MSVS 2013. You should be able to find a Clone button from the Team Explorer. Simply click on it and it will let you clone from any URL which means you can put Bitbucket link over there too.

http://i.stack.imgur.com/0y8oW.png

And once it's synced, you are good to go.

http://i.stack.imgur.com/Oenv7.png

Solution 3

Visual Studio 2013's "slick Git integration" requires Team Explorer, which means you need Team Foundation Server. To enable it, open your solution, go to Tools -> Options -> Source Control -> Microsoft Git Provider.

You may be better off getting the Git Source Control Provider plug-in. See this answer on how to install this plug-in for Visual Studio 2013: https://stackoverflow.com/a/18882284/1040437

Also, considering the power of the git command line, I do not think, based on the screenshots I have seen using it, the integration is all that slick. It seems rigid, and as somebody has already commented, you may be better off using TortoiseGit. Anyone who has used TortoiseSVN on your team will instantly find it familiar. Some of my coworkers use the command line, and they are divided between Git Bash and Posh-Git.

My main gripe with the Visual Studio integration is it only supports one workflow. Take a look at how toolchains like Atlassian's Stash support multiple different development workflows and how Stash changes depending on your git workflow. This is a more intelligent way to design IDE-like features around git source control repository.

Our particular workflow set-up at work is especially resistant to the "common scenario" in modern SaaS development, where you have one main line of development and no cherrypicking/rebasing ever, because you always march forward and upgrade everyone to the latest code. We currently have 7 lines of development...

That said, I have found this article via googling "Visual Studio 2013 git": http://msdn.microsoft.com/en-us/library/vstudio/hh850437(v=vs.120).aspx

Solution 4

Found this step by step tutorial on the answers.atlassian.com helpful (FOR VS2015 and git bitbucket.org)

  1. From the Bitbucket website, create a new repository by clicking on your profile icon, and then go to "View Profile".
  2. Here you will find the "Create Repository" button. Click it. – I have no idea why this button is located here.
  3. Give your repository a new name. For consistency's sake, I name my repository the same name as the solution.
  4. Click the "Create Repository" button
  5. Once your new repository has been successfully created, go to the ellipsis menu button on the left, and then click on the "Clone" menu item.
  6. Copy the HTTP URL provided.
  7. Now let's go to our Visual Studio 2015 and open your existing project!
  8. In your "Solution Explorer", right click on your solution name, and select "Add Solution to Source Control ...".
  9. Go to your "Team Explorer" and click on the "Manage Connections" icon on the top.
  10. Double click on your Repository name under the "Local Git Repositories" section.
  11. Now click on the "Sync" menu option.
  12. Under the "Publish to Remote Repository", click the "Get Started" link.
  13. Paste your URL within the highlighted box, and click "Publish".
  14. Now go back to the BitBucket website. From the top menu click on the "Repositories", and click on your repository name. You will now see your project files. Reminder: After modifying a file, your changes get "checked in" only when you "Commit" changes and then "Sync" the repository. You can do this by following these steps.
  15. In the "Solution Explorer", right click on your file after saving your changes, and select "Commit".
  16. Enter your comments, and click the "Commit All" button.
  17. Go back to "Manage Connections" within the "Team Explorer" and then under the "Local Git Repositories", double click on your repository's name. Click the "Sync" menu item.
  18. Click the "Sync" link.
  19. Go back to the Bit Bucket website and open the file within your repository's directory and you will see your changes in there.

source: https://answers.atlassian.com/questions/39574410/bit-bucket-and-visual-studio-2015

Solution 5

There is an extension to do it now - Visual Studio Bitbucket Extension https://visualstudiogallery.msdn.microsoft.com/6f8954a6-2358-4f4a-b69b-e51199935fad

This extension was submitted to devpost contest where you can find screenshots. http://devpost.com/software/bitbucket-extension-for-visual-studio

When installing visual studio there is an option to include GitHub extensions. This extension is a counterpart for Bitbucket. It allows you to Create/Clone/Publish Bitbucket Git repositories in a very simple way. Once you login you can create new repository and publish it to Bitbucket. If you have existing bitbucket repositories you can list them and choose which one you want to clone. In addition you get access to pull requests from actual repository. You can create new pull requests, approve/disapprove them and also view details like files changed, commits and comments.

Share:
89,142
Dean Chalk
Author by

Dean Chalk

I work for British Petroleum (BP) in the UK as a senior software developer. I specialise in complex and high-performance Windows desktop user interfaces. I am an Enterprise software developer with over 20 years software development experience. Over the years I have been a developer in many technologies, but I am an expert in Microsoft software development for thick-client desktop apps (WPF / Winforms / UWP), which I have specialised in since 2004. Since 2006, I focus exclusively on XAML based enterprise application development (WPF & UWP).

Updated on January 18, 2020

Comments

  • Dean Chalk
    Dean Chalk over 4 years

    Visual Studio 2013 apparently has some nice slick Git integration.

    However, after an hour of head-scratching with absolutely nothing making even the slightest bit of sense, I've only been able to create a local repository and despite cloning a remote bitbucket repository I simply cannot find a way to publish to my remote repository.

    I've used TFS, Subversion, Perforce and just about everything else, but this is completely baffling, with no instructions and a completely un-intuitive user interface.

    Any ideas anyone ?

  • Neil
    Neil over 10 years
    Sorry to tag onto an old question, but know how to add multiple remotes? I want to try out TFS as a remote git server, but want to also commit to github periodically to be safe.
  • John Zabroski
    John Zabroski over 10 years
    Agreed, my statement was not correct. I have revised it below.
  • stone
    stone almost 10 years
    Thank you so much! The screenshots made it so easy to follow.
  • Hoppe
    Hoppe almost 10 years
    I found GIT integration in vs2013 very confusing, and was looking for a tutorial like this. Very clear. Many thanks
  • tom_mai78101
    tom_mai78101 over 9 years