Streamlining Development - Our Journey with Git, Bitbucket, and Jira
In our development team, we’ve recently made a significant change to how we work. We’ve adopted the Git Feature Branch Workflow
, along with Bitbucket
and Jira
. These tools have transformed how we build software, making it easier to collaborate, manage tasks, and maintain a structured codebase.
Here are the steps:
Set Up the Repository:
- Create a Git repository on Bitbucket to host our project’s codebase.
- Invite team members to the repository, granting them appropriate access levels.
Create the Jira Project:
- Set up a Jira project to manage tasks, issues, and project tracking.
- Integrate the Jira project with the Bitbucket repository to link code changes to specific tasks/issues.
Branch Naming Convention:
Establish a clear and consistent branch naming convention.
For example:
feature/<Jira-Issue-Key>-<short-description>
for feature branches.bugfix/<Jira-Issue-Key>-<short-description>
for bug fix branches.hotfix/<Jira-Issue-Key>-<short-description>
for critical hotfix branches.
Workflow:
Main Branches:
- master: Represents the production-ready codebase.
- develop: Integration branch for ongoing development and testing.
Feature Branches:
Developers create feature branches from develop to work on specific tasks or features.
Bug Fix Branches:
Developers create bug fix branches from develop to address specific issues.
Hotfix Branches:
For critical production fixes, create hotfix branches from master.
Development Process:
New Feature/Bug Fix:
- Developers create a new branch from develop or master, depending on the nature of the task.
- Work on the feature/bug fix and commit changes to the branch.
- Regularly push the branch to Bitbucket to enable collaboration and backups.
Code Review:
- Open a pull request (PR) on Bitbucket when the feature/bug fix is ready for review.
- Assign the PR to one or more team members for review.
- Team members review the code, provide feedback, and request changes if necessary.
- Developers make adjustments based on feedback until the PR is approved.
Merge to Develop:
- Once the PR is approved, merge the feature/bug fix branch into develop.
- Test the changes in the develop branch to ensure everything is working as expected.
Release:
- When the develop branch is ready for release, create a release branch from develop.
- Test the release branch thoroughly.
- Merge the release branch into master and tag it with a version number.
- Deploy the code from master to production.
Hotfix:
- For critical production issues, create a hotfix branch from master.
- Make the necessary changes in the hotfix branch.
- Merge the hotfix branch back into both master and develop.
- Deploy the code from master to production.
Jira Integration:
- Link Jira issues to related pull requests on Bitbucket.
- Add commit messages or branch names that include Jira issue keys to automatically link them to corresponding issues in Jira.
Documentation:
- Encourage developers to maintain comprehensive documentation.
- Document the workflow and update it as needed to ensure everyone follows the same process.
By following this workflow, our team can maintain a structured and collaborative development process, making it easier to track progress, manage code changes, and deploy releases.
Got a project in mind? Send me a quick message, and I'll get back to you within 24 hours!.
Recent Posts
- Disabling Payment Methods in WooCommerce Based on Conditions
- How to Update Product Quantity in WooCommerce Using Custom Code
- Dynamically Generating a Table of Contents in WordPress
- Direct Checkout in WooCommerce - Add Product to Cart from Checkout Page & Skip Shop, Product, and Cart Pages
- Understanding the Impact of git reset --hard Command
Your Questions / Comments
If you found this article interesting, found errors, or just want to discuss about it, please get in touch.