Git Workflow
OverView
In our current day-to-day coding work, we are following GitFlow. Please check the link to learn details Gitflow Workflow .
Every developer should follow the following rule strictly otherwise no pull request will merge.
Rule to Follow:
We are using Gitflow (simplified):
There must be no direct commits to the development/master branch.
Each story/bug/task must be developed on a separate branch. it is not applicable for the subtask.
Branch name should be correlated with bug/feature name
Merge develop branch to feature branch often to limit conflicts
Code must be merged to develop branch by a pull request from Bitbucket
Merge can be done after testing bug on the branch
Pull request must have a reviewer and must be reviewed by other team member or at least Tech Lead before merge
It is very easy to spot most simplest problems with code
Comment code, not a person
When reviewed - don't take it personally
Branch naming format is in TitleCase (if no JIRA ticket JIRA parts can be skipped): {JIRAQueue}-{JIRANumber}-{TicketTitleOrTwoThreeWordsOfDescription}. (Example: CE-321-FixForSavingTicketStatus)
Commits must have meaningful note and ticket / bug number from JIRA if applicable, First line format: {#JIRAQueue}-{JIRANumber} - {Ticket Title Or Description} (Example: #CE-123 - Added Additional Status Check) . try to. use some keywords in the commit such as Added/Updated/Deleted etc.
Pull Request title should match/be close to branch/bug name and contain Jira ticket number.
For HotFix(Customer Issue/ Production fix) branch should be created from the master branch and pull request should be created to master and develop the branch.
For any new story/task/bug create a feature branch from develop branch and send a pull request to develop the branch after finish work.
Never change automatic merge commit message manually (to sync or merge, leave it as is)
Add Tag to master / develop branch after each prod deployment, it is important to know when the deployment was and which changes are not included in prod.
Rule to work on Customer Issues:
Create a separate branch Hotfix_TaskName_ReleaseDate from master
Developers will provide pull requests to this HotFix branch.
We will deploy this branch to Dev Env for the test.
After pass the test, provide a pull request from the HotFix branch to the Master and Develop branch.
If the test fails go to step 2.
Release master branch