How to setup multiple Git accounts?

Hello,

I have two git hosting accounts at Bitbucket. One for work related projects and another is for personal projects. When I create a project, I want to be able to specify which account the project is hosted on. I don't seem to be able to do this - am I missing something?

It looks like the VCS can only be setup (in this case Bitbucket plugin) for a single remote repo because it is under the IDE settings and not under the per project setting. And so every time I open a project that is a personal project, I have to change the login under the global IDE settings. And when I switch to a work project I have to change the login again.

It would be nice if the logins could be specified on a per project basis and not globally.

5 comments
Comment actions Permalink

Hello,

BitBucket plugin is supported not by JetBrains, but by Atlassian.

0
Comment actions Permalink

Good to know, thanks!

0
Comment actions Permalink

Apparently nobody knows. I gues it means that nobody is using Bitbucket with PhpStorm? I am not getting feedback from the dev guy as to why am I getting this error. He said it works for him when he did a clean install. I did a clean install as well and I'm getting the same error on two different machines.

I don't know if I'm missing another plugin or...? I guess so much for using Bitbucket with PS - unless I use a 3rd party GUI tool, of course.

0
Comment actions Permalink

Hi Pen,

Git supports pointing your local repository at multiple remotes. I belive that even if the IDE does not provide a GUI solution, you can still either run 'git remote' to add your bitbucket repo or edit your .git/config in the root directory of your project (details: http://gitref.org/remotes/#remote). Once you've configure your remote repositories, you should be able to use the IDE's VCS featues as normal.

If you want to clone a repostory on bitbucket from an account other than what you've configured your IDE to use, I would clone it from the commandline (or some other third party Git GUI)  first, then open the project in the IDE. You should then be prompted by the IDE to assume the setting of that local repository.

I hope this is helpful,

- Mike

0
Comment actions Permalink

Tanks for the feedback, Mike. Maybe I wasn't too clear on my first post. I have my remotes setup and they are working just fine using SmartGit v3. However, the issue is that the two remotes use two different logins.

For my personal projects repo, I login to Bitbucket with the credentials user1/password1.
For my work projects repo, I login to Bitbucket with the credentials user2/password2.

In PhpStorm I can only define a single user/password combo which is under the global IDE setup and not under the project settings. Therefore I do not understand how can I manage two different projects that use two different remote repos under two different accounts, since PhpStorm only allows me to specify a single user login.

SmartGit, however, is very straightforward. For every project, I have to define my remote repo for which I have to specify (aside from the repo URL) my username and password. So if I open another project in SmartGit, now I have a different set of credentials defined for the project. Easy and simple. I am missing this from PhpStorm and puzzles me how to do this.

Of course I can just use SmartGit, but since PhpStorm already has a very nice gui, ideally I don't want to use two separate programs when I could do everything under one roof.

0

Please sign in to leave a comment.