Workflows
Last updated
Last updated
If you use the Extension git-flow, keep in mind that it will commit and push to main
automatically through the scripts execution.
Thus you may not be able to create Pull Requests.
It is an alternative Git branching model that involves the use of feature branches and multiple primary branches.
It has numerous, longer-lived branches and larger commits.
Under this model, developers create a feature branch and delay merging it to the main trunk branch until the feature is complete.
This can lead to higher risk of deviating from the trunk branch and introduce conflicting updates.
Gitflow can be used for scheluded realese cycle projects and for DevOps best practices of CD
.
It doesn't add new concepts or commands from what is required from Feature Branch, instead it assigns very specific roles to different branches and defines how and when they should interact.
In addition to feature
branche, it uses individual branches for preparing, maintaining, and recording releases.
We will have two branches to record the history of the project.
Other developers should now clone the central repository and create a tracking branch for develop
.
main
branchStores the official release history, but only an abridged version.
All commits here should be tagged with a version number.
develop
branchServes as an integration branch for features, meaning done
feature branches will ONLY be merged here. (Never to main
)
develop
branchManually:
Using git-flow extension:
If using git-flow extension library, executing git flow init
on an existing repo will create the develop
branch.
Each new feature should reside in it's own branch, which can be pushed to the central repositoy for backup/collaboration
.
feature
branches will always branch off from develop
, never from main
.
When it is complete, it gets merged back to develop
.
Note: feature
branches combined with the develop
branch is Feature branches workflow.
Create a new local feature/<branch-name>
from develop
.
Work on feature...
Merge to develop
.
Delete the feature/<branch-name>
.
Working with PR and Rulesets will not let you merge or push to main
or develop
from terminal.
Create a new local feature/<branch-name>
from develop
.
Work on feature...
When finished, go to GitHub and create a PR on feature/<branch-name>
.
Finish the PR, merging to develop
.
On your local repository delete the feature/<branch-name>
.
feature
branchesManually:
With git-flow extension:
feature
branchManually:
With git-flow extension:
Once develop
has acquired enough features for a release (or a predetermined release date is approaching), you fork a release
branch off of develop
.
Creating this branch starts the next release cycle, so no new features can be added after this point, ONLY: Bug fixes, documentation generation, and other release-oriented tasks should go into release
branch.
Once it is ready to ship, the release
branch gets merged into (main
and develop
) and tagged with a version number.
You can follow SemVer versioning scheme of <major>.<minor>.<revision>
.
release
branches will always branch off from develop
.
When it is complete, it gets merged into main
and develop
.
Create a new local release/<branch-name>
from develop
.
Add docs, bugfixes, hotfixes....
Merge to main
and develop
.
Delete the release/<branch-name>
.
Tag the commit on main
with an updated version number.
Working with PR and Rulesets will not let you merge or push to main
or develop
from terminal.
Create a new local release/<branch-name>
from develop
.
Add docs, bugfixes, hotfixes....
When finished, go to GitHub and create a PR on release/<branch-name>
.
Finish the PR, merging to develop
.
Manually merge squash release/<branch-name>
into main
.
Create a new Release on GitHub with an updated <major>
or <minor>
version number.
On your local repository delete the release/<branch-name>
.
release
branchesManually:
With git-flow extension:
release
branchManually:
With git-flow extension:
Maintenance or hotfix branches are used to quicky patch production releases.
This is the only branch that should fork from main
.
hotfix
branches will always branch off from main
.
When it is complete, it gets merged into main
and (develop
OR the current release
branch).
You can follow SemVer versioning scheme of <major>.<minor>.<revision>
.
Create a new local hotfix/<branch-name>
from main
.
Work on the hotfix...
Merge to main
and (develop
or release
).
Delete the hotfix/<branch-name>
.
Tag the commit on main
with an updated version number.
Working with PR and Rulesets will not let you merge or push to main
or develop
from terminal.
Create a new local hotfix/<branch-name>
from main
.
Work on the hotfix...
When finished, go to GitHub and create a PR on hotfix/<branch-name>
.
Finish PR, and merge on main
.
Manually merge squash hotfix/<branch-name>
into develop
or release
.
Create a new Release on GitHub with an updated <patch>
version number.
On your local repository delete the hotfix/<branch-name>
.
hotfix
branchesManually:
With git-flow extension:
hotfix
branchManually:
With git-flow extension: