Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Visual Studio: how to connect a local repo to a bitbucket cloud repo?

ic2 August 13, 2018

I have a VS solution. With VS File/Add to Source Control I get a local repository in the solution directory. I can then create a bitbucket repo from this, commit & Sync from VS and see the changes from VS in my Bitbucket login.

Now I want a 2nd user to do exactly the same. He should be able to commit & sync his changes, I should be able to pick these up (pull) and the other way around.

But I have no idea how to accomplish this. Obviously he can not create a remote repo from his solution directory, because we have this already. But we can not clone the Bitbucket repository either because Visual Studio commits in de solution directory and if we tell to clone into that directory we get a warning that this directory is not empty. But that is exactly where we need it!

We have no way to tell Visual Studio to clone into another directory than the solution directory and, the other way around, we have no way to tell Bitbucket to connect the local repository in the VS solution directory. So I am stuck with my simple desire to have a few developers update the changes from others.  I don't need anything elaborate like different branches and forks  - just update the code in a couple of equally set up VS solutions of multiple developers.

What can I do?

 

Dick

1 answer

0 votes
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 22, 2018

Hi Dick!

First of all, I'll assume you're using the Visual Studio Bitbucket Extension.

 

But I have no idea how to accomplish this. Obviously he can not create a remote repo from his solution directory, because we have this already.

Why can't he create it? Are your users sharing the same machine? Do they have separate user profiles?

If they're using the same machine and the same profile, then it will be a problem. They'll need to use different profiles so each of them can install Visual Studio and clone the repo from Bitbucket to their directory. 

The same would happen with Sourcetree, your users will need to have separate user profiles in the computer so they can install Sourcetree separately, log in to Sourcetree using their individual accounts and then cloning the repos from Bitbucket.

If the users are not using the same machine, can you please elaborate a bit more on why they're not able to clone the same repo?

Kind regards!

Ana

ic2 August 28, 2018

Hello Ana,

 

Thanks for the reply. What we need is this:

 

                             Bitbucket cloud repo project 1

                      /                              \

PC1 local project 1                      PC2 local project 1

If user with PC1 makes changes in project 1 the user with PC2 should read (pull) the changes. And the other way around. I am user 1 (admin) and created Bb repo 1 so that's why I wrote that obviously user 2 can't do the same as I did (which include creating the cloud repo - and this must only be created once...)

Is this more clear?

I think however I solved it. I manually copied his solution and (re)created the Bitbucket cloud repo. I then let user 2 clone the Bb cloud repo and he moved it to the same location as he had his original solution, after deleting his original code. This cloned solution seem to contain (more or less) the same as his original project. Now we seem to be able to do what I describe above, that is after fighting several access problems with the Visual Studio credential manager. But hey, it's Visual Studio we work with so we are used to spending half the day solving problems.

I am not sure if this is the way to go because it feels like a bag of tricks. But I think it works.

 

Dick

Like TimsSmit likes this
Ana Retamal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 1, 2018

Hi Dick, sorry for my late reply, for what I understand this approach sounds right. Hope it's been working good for you and if it doesn't, please let us know! Although I don't think there's much we can do on the VS side ;)

Cheers!

Ana

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events