I've created private git repo at bitbucket. After that I've added https git repo url to PHPStorm; entered all requested credentials (repo is private). Connection succeeded. Currently I'm at master branch. I'm starting to add files to project and to adding to git (using PHPStorm GUI). I've created private git repo at bitbucket. After that I've added https git repo url to PHPStorm; entered all requested credentials (repo is private). Connection succeeded. Currently I'm at master branch. I'm starting to add files to project and to adding to git (using PHPStorm GUI). After that I'm trying to commit and push changes.
FeaturesPhpStormTutorials
In a previous post we saw how PhpStorm handles Version Control Systems (VCS). A very popular VCS is Git, driven by the collaboration that’s possible using GitHub. In this post, we’ll explore several integrations with GitHub that are available from within your IDE:
- Create a GitHub repository
- Clone a GitHub repo
- Create a gist on GitHub
- Open in browser
- Use the GitHub issue tracker
Next to those actions, PhpStorm provides full support for the Git VCS like commit and update file/directory or an entire project, changelists, revision support and so forth. More on these features can be found in our earlier VCS overview post.
This functionality is available in IntelliJ Idea, PyCharm, WebStorm, PhpStorm, RubyMine, and AppCode.Before we start, make sure that PhpStorm knows the path to your Git executable. Refer PhpStorm web help on how to do this (“prerequisites”).
It’s also best to make sure that you have registered your GitHub account credentials or signed up for a GitHub account through PhpStorm. Doing this ensures that you don’t have to provide your GitHub account details every once in a while.
Create a GitHub repository
Whenever you want to start a new project on GitHub, there’s always a bit of a chicken-egg problem. Do you start coding and then push the initial code to GitHub? Or do you create a project on GitHub, clone it locally and then start coding? Depending on what you like for breakfast (chicken or egg), PhpStorm supports both, right from the IDE.
Once our project is ready to be published on GitHub, we can use the VCS | Import into Version Control | Share project on GitHub menu item to start publishing the project.
PhpStorm will then ask us to provide a repository name and description. After doing that, click the Share button.
There we go: our project is now available on GitHub and we haven’t left our IDE! From now on we can use any other command from the VCS menu as described in this post.
Clone a GitHub repo
What if we want to continue working on an existing project hosted on GitHub? Typically, we would have to open a browser and navigate to the repository website to copy the URL we can clone using Git. Another approach would be memorizing the repository URL and cloning that. Why not clone a project from GitHub right from within PhpStorm?
From the VCS menu, we can use the Checkout from Version Control | GitHub command. This will fetch a list of all repositories that we can access using our account and allows us to clone those into a PhpStorm project:
After clicking the Clone button, we’ll have the entire repository contents available locally and can code away. Once finished, simply use the traditional Git commands from the VCS menu.
Create a Gist on GitHub
If you’re unfamiliar with gists: they are a simple way to share snippets and pastes with others. They can be created, browsed and commented through https://gist.github.com/. Why copy/paste code from our IDE into a browser window if all it takes is a right-click?
How To Use Bitbucket
From any file that’s opened in the IDE, we can make a selection of code, right-click and use the Create Gist… context menu. We can provide a description and optionally make the gist private or anonymous.
After you click OK, the selected code (or the entire file if no code was selected) will be uploaded as a gist to GitHub.
Open in browser
Ever wanted to see all details on the file you’re working on? Right-click a file and select Open in browser from the context menu. This will launch the default browser and open the file we’ve clicked on in GitHub. This allows us to see file history, explore branches and whatever other action we may want to do through the GitHub web interface.
Use the GitHub issue tracker
Phpstorm Bitbucket Credentials
Working on a project often means working with issue tracking. And since GitHub has an issue tracker, let’s explore how that integrates with PhpStorm. To do so, there’s a small configuration step we have to take first.
From the File | Settings menu, we’ll have to open the Tasks | Servers pane under the current project settings and do some minor configuration: add the issue tracking server we want to use. Add a new server, enter the URL to your GitHub repository and provide the required credentials. Under the Commit Message pane, enable the Add commit message option and optionally customize the commit message that will be generated when we complete a task.
From now on, we can work with issues from GitHub and correlate source code commits with specific issues and tasks. Let’s create a new task. On the main menu, choose Tools | Tasks & Contexts | Go to Task or simply press Alt+Shift+N. This will open up a dialog which allows you to select an existing task to work on or create a new task.
We can now enter the task we want to work on and press Ctrl+Enter (Mac: Cmd-Enter) if the suggested task is the one we meant to be working on. After clicking OK this dialog will close and PhpStorm will close all files currently opened and create a new context for the work we’re going to do. On a side note, if we wanted to have more details on the task we’ve just selected we can use the Tools | Tasks & Contexts | Open task in browser menu or press Alt+Shift+B. This opens up a browser window with the issue logged on GitHub if you require additional information.
After making some changes, we first have to make sure PhpStorm captures all changes made to our project in a changelist. Use the Tools | Tasks & Contexts | Create Changelist… menu to do so. A changelist is a set of changes in files that represents a logical change in source code. The changes specified in a changelist are not stored in the repository until committed (pushed).
We can now work on other tasks and create changelists for them. Once we feel our code is good to be stored in the VCS again, we can use the VCS | Commit Changes… menu or Ctrl+K (Mac: Cmd-K) to commit changes to the repository. Note that the commit message is automatically generated based on the issue we were working on:
When working with PhpStorm, a lot of GitHub functionality is integrated in the IDE. We’ve done a couple of tasks that are normally performed either on the command-line or through the browser, right from the IDE. This integration will help you be more productive because there’s less context-switching occurring.
Develop with pleasure!
– JetBrains Web IDE Team
LindaUncategorizedWhile Jira integrates nicely with a lot of tools, nothing beats its Bitbucket integration for combining your development and management workflows.
It’s no surprise Bitbucket and Jira get along so well: they’re both Atlassian tools. And they’re both mature products, focused on helping developers build complex software.
Here I’ll put together the definitive guide to integrating Bitbucket and Jira for the modern development team. I’ll show you how to get off the ground, and how to get the most out of your integrated platform.
Bitbucket Types
One quick note before we begin: there are two types of Bitbucket installations. Bitbucket Server and Bitbucket Cloud. Both offer greatrepository hosting and and both integrate seamlessly with Jira.
Bitbucket Cloud takes everything out of your hands. Atlassian manages the details, and you only worry about your repositories. For folks who need a little more control, there’s Bitbucket Server. With Server, you manage the hosting and your code stays entirely on your servers.
Everything in this article applies equally to the Cloud and Server versions of Bitbucket, except for actually installing the integration. You should make sure to follow the instructions for your version of Bitbucket to get the integration up and running.
After that, you can treat both versions exactly the same!
Why Integrate Jira and Bitbucket in the first place?
First things first, why go to the trouble of integrating Jira and Bitbucket?
Actually, there are a lot of great reasons.
For starters, both tools have a lot of awesome features that can only be enabled if they’re integrated. As we’ll see later, integrating unlocks some great features on tools that you’re already paying for. If you’re spending the money, why not get the most out of it?
On top of that, another great reason is to allow your Jira to see what’s going on in the development process. Many teams use Jira as the final source of truth for project management. Adding a Bitbucket integration allows you to see the full picture.
Note: Read more about Jira in our Intuitive Jira Guide for Users.
Getting Started with the Jira Bitbucket integration.
Once you’ve decided to link your Jira and your Bitbucket, Atlassian makes it incredibly easy to actually get them connected. In fact, you can initiate the link from either Jira or Bitbucket.
The integration works through application links, which you can find in the admin section of your Bitbucket server. Jira is one of the predefined options, so from there you just follow the instructions and fill in your details. Bitbucket takes care of the rest!
After that, you should be able to see your Bitbucket details on Jira tickets.
Optimize Bitbucket for Jira’s Tooling
The base integration you’ve added will go a long way towards making your management easier.
But you can get even more out of the integration by making some quick changes to how you manage your Bitbucket development process.
To start, consider defining your branching strategy in Bitbucket. Branching strategies are a feature that let you set a naming convention and a merging strategy for new branches.
For example, in the feature branch workflow, you make new named branches for each new feature, and merge them into master after review.
Why is this important? Because with the integration, you can create and manage branches in Jira as easily as you can in Bitbucket.
Starting development on a new story in Jira? You can click to create a branch, and Bitbucket will follow your strategy selected above.
One other can’t-miss feature is Smart Commits. By including a few extra commands in your commit messages, you can now tell Jira to take actions whenever your commits land.
Want to mark a ticket closed with your latest commit? Just include the ticket id and the string #close in your commit, then push to Bitbucket.
Even better, you can even track your time in Jira using Bitbucket commits. Just include #time and the amount of time you spent, and it will get logged in the ticket.
Build Bitbucket into your Jira workflow
Git Bitbucket Tutorial
Of course, after you’ve done all that work on the Bitbucket side of things, there are some settings and practices you should tweak in Jira as well.
Many organizations are using Jira as a repository for information about the status of their projects. They use Jira to plan, track hours, and schedule future development.
This is great because Jira integrates with many other SaaS applications: billing software, customer support providers, and more. One way to think of the Bitbucket integration is as another pipeline of information, flowing into your Jira.
For example, one easy step to bring Bitbucket information into your Jira is to set up status triggers.
These allow you to change the status of tickets in Jira when events happen in your repository.
Pull Request just opened on a branch? Your ticket can automatically go from In Development to Code Review. This lets you see that latest status of development on all your projects.
Even without configuration, having the integration set up allows you to see the status of your repository without leaving a ticket.
If you’re using Smart Commits correctly, you should be able to see open pull requests, new commits, and release stages for everything linked to a ticket.
One more thing to try: Bitbucket has a powerful tool called hooks, that let you enforce rules on commits when they come into your repository. There are several hooks in the marketplace that let you require all commits to mention the related Jira issue or else they’ll be rejected. That way, you don’t have to rely on everyone remembering to include an issue key!
Note: Learn more about more about Jira Workflows in this blogpost.
Get To Know Hooks
Speaking of which, the hooks feature in Bitbucket Server is a great way to automate common actions related to managing code. If you’re building your code on a CI server, or running automated tests, hooks are a great way to manage that complexity.
In terms of integrating with Jira, there are a lot of great options out there! Check out the hooks menu to see what Bitbucket can do.
There are hooks for scanning your repository for “TODO” comments and creating issues from them, hooks for tracking technical debt, and hooks for helping out pull requests.
For BitBucket Cloud, there’s a similarly powerful feature in git-hooks. These scripts let you run code whenever developers make a change. You add the commits to your repository, new developers enable them, and the code is run whenever they commit.
Make the Most Out Of Pull Requests
One place the Jira Bitbucket integration really shines is in working with pull requests.
Bitbucket already has a great pull request interface, but Jira lets you take it to the next level.
This feature is under active development, so expect additional improvements over time.
When reviewing code, it’s common to suggest changes that need to be completed before merging.
Bitbucket lets you create a Jira ticket without leaving the pull request page, so you can continue your review uninterrupted.
For a given Jira ticket, there can be several users who are attached to the outcome. The original reporter, the ticket assignee, and the project lead for a given project.
Now that your tools are integrated, you should go through and ensure these are all aligned.
For example, you can set the default pull request reviewer in Bitbucket to be project owner in Jira to increase ownership of a project.
All this helps maintain Jira as an up-to-date dashboard of your project’s health.
What Is Bitbucket
When doing a code review in Bitbucket, you can compare the new code to the original ticket (and possibly even the customer bug reports that generated the ticket in the first place). Likewise, you can click through the pull request link in Jira to check the status and resolution of review tasks.
Try Out The Release Hub
One other great tool for projects with the Bitbucket integration enabled is the release management view, also called the Release Hub.
Release Hub lets you view visualize the status of your project and plan for an upcoming scheduled release. It provides a great burndown view to show you how much is left to do before your release date.
The Release Hub lets you see the status of all tickets for the release you’ve selected, along with their status in your Bitbucket repository.
You can see the outstanding issues, as well as a burndown chart showing estimated time left till release.
Conclusion
Views like the Release Hub show you the power of integrating your repository and your project manager.
In Jira, you get to see up-to-the-minute status on everything your developers are working on, and keep closer tabs on the projects you’re managing.
In Bitbucket, you no longer have to flip between tabs to see your issues, or to create follow up tickets for your reviews.
In both cases, the integration helps your tools get out of your way, and make the development process that much easier.
Recommended Reads:
- Why Bitbucket is Better than Github.
- How to implement a Jira Migration (a step-by-step guide)
- How to set up the perfect Jira notification Scheme
- Jira Confluence Integration: The complete 2020 guide
- Key Updates of Atlassian Products 2020 (what you should know)
- Why Jira is better than Trello, even for non-developers
- 10 Expert Tips to 10x your Productivity in Jira