DevOps Learning: Branching Strategies
When learning DevOps, I make it a goal to cover at least one topic each day. Today, I’m focusing on branching strategies. Based on my research and experience, I’ve noticed that many companies use the following structure, often managed through JIRA, a project tracking and issue management tool. JIRA helps teams track progress, visualize pending tasks, and understand team members’ contributions.
Branch Structure
- Master Branch ([prd])
- This is the production branch where live code runs.
- It’s the version of the application that users and clients interact with.
2. Staging Branch ([stg])
- This branch is a copy of the master branch.
- It serves as a testing environment where internal users test features before they’re pushed to production.
- If testing is successful, changes are merged into the master branch.
3. Development Branch ([dev])
- This is the main working branch for developers.
- Developers create their own branches from this dev branch for specific tasks or tickets.
- Developers work on their assignments, make commits, and push changes back to the dev branch.
Role of JIRA in Branching
JIRA plays a crucial role in tracking the progress of development tasks. Here’s how it’s used in this workflow:
Columns in JIRA
- To Do / Tickets: New tasks or tickets are created and listed here.
- In Progress: When a developer starts working on a task, they move it to this column.
- Ready to Test: Once the work is complete, the task moves to this column, where QA tests it.
- Merge to PRD: If the task passes testing, it’s ready to be merged into the production branch.
Example Workflow
- A new task, like working on a Docker file, is created in the To Do column.
- A new branch is created from the dev branch, named after the ticket ID (e.g.,
ticketID/docker-file). - The developer works on the Docker file and moves the task to the In Progress column.
- Once completed, the task moves to the Ready to Test column, where QA tests it.
- If testing is successful, the changes are merged into the production branch (prd), and the task moves to the Merge to PRD column.
Hotfix Strategy
Sometimes, issues arise in the production (master) branch that need urgent attention. Here’s how hotfixes are handled:
- A new ticket is created in JIRA to document the issue.
- A new branch is created directly from the master branch, named after the ticket ID (e.g.,
ticketID/hotfix). - The developer works on the hotfix and pushes the changes to this branch.
- Once the issue is resolved and tested, the branch is merged back into the master (prd) branch to ensure the fix goes live.
Here is the YouTube Link: https://youtube.com/@raeesq.?si=v_QK6Q2XXMf9mKep
Final Thoughts
This simple branching strategy, combined with JIRA’s tracking capabilities, helps ensure smooth collaboration and efficient development. It’s a systematic way to handle development, testing, and production changes. If you found this helpful, please share it with others and continue learning DevOps one step at a time.

Comments
Post a Comment