Reputation: 228
I've just set up BitBucket server on a local (LAN) server, and I use PhpStorm (version 2017.1.4).
I want to use PhpStorm's built-in Version Control to make the process quicker and easier (being able to commit from PhpStorm instead of using SourceTree).
I tried using the built in Git integration, but when trying to checkout, I can only put a URL, Parent Directory and Directory Name, not a username or password for my account on BitBucket Server.
This means when I click "Clone", I get the message
Clone Failed. Authentication failed for {my_bitbucket_url}
I've searched around and found a BitBucket plugin for PhpStorm but it seems to only support BitBucket Cloud, and not server, as it asks for Username and Password, rather than a URL. I can't seem to find much information at all regarding BitBucket Server integration.
Any idea what I'm missing, if this is even possible?
UPDATE:
I have managed to get PhpStorm linked up to my BitBucket Server a bit. I can now checkout a branch from the server and switch between different local branches. However, the one thing I can't do is push to a remote branch. I get the error
Push failed. Failed with error: Authentication failed for {my_url}
Upvotes: 2
Views: 2818
Reputation: 228
Ok, so I finally managed to figure this out.
Firstly, cloned the repo using SourceTree and set the git directory as the project directory
I was originally accessing my BitBucket Server through https with a username and password, but I got it working by setting up an SSH key using Putty and added that to BitBucket Server. This made it work through the terminal in PhpStorm but not the VCS controls
To sort this, I used this link as a reference (especially the environment variable) and also another environment variable with name "GIT_SSH" and value as a link to plink.exe to force git to use Putty instead of the default
Upvotes: 2
Reputation: 11
If you have already checked out your Bitbucket repo, then opening your local copy of that repo as a project in PhpStorm should be enough to link everything up.
At least that's all I had to do, I was previously committing everything through command line but once I created my projects using my local repo's as the source directories, PhpStorm's VCS imported all my Git history and details for my Bitbucket repo's.
Second Option:
Failing that working, try this Bitbucket connector.
Once you download it, you just need to extract the archive and move the "Bitbucket" folder into your PhpStorm plugins directory (On my system that's located "C:\Program Files\JetBrains\apps\PhpStorm\ch-0\171.4424.11\plugins").
Then restart PhpStorm enable the "Bitbucket" plugin if it isn't already and then from the menu bar use "VCS > Checkout from Version Control > Bitbucket".
Upvotes: 1
Reputation: 986
You need to install "BitBucket Linky" plugin from Settings/Preferences > Plugins > Browse repositories. It supports both Cloud and Server. Check the overview and existing issues at plugin's BitBucket page.
Upvotes: 2