Workflows

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 vs Feature Branch
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.
Develop and Main branches
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 branch
main branchStores the official release history, but only an abridged version.
All commits here should be tagged with a version number.
develop branch
develop branchServes as an integration branch for features, meaning done feature branches will ONLY be merged here. (Never to main)
Creating the develop branch
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.
Feature branches
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.
Feature steps (No PR)
Create a new local
feature/<branch-name>fromdevelop.Work on feature...
Merge to
develop.Delete the
feature/<branch-name>.
Feature steps (With PR and Rulesets)
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>fromdevelop.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>.
Creating feature branches
feature branchesManually:
With git-flow extension:
Finishing a feature branch
feature branchManually:
With git-flow extension:
Release branches
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.
Release steps (No PR)
Create a new local
release/<branch-name>fromdevelop.Add docs, bugfixes, hotfixes....
Merge to
mainanddevelop.Delete the
release/<branch-name>.Tag the commit on
mainwith an updated version number.
Release steps (With PR and Rulesets)
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>fromdevelop.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>intomain.Create a new Release on GitHub with an updated
<major>or<minor>version number.On your local repository delete the
release/<branch-name>.
Creating release branches
release branchesManually:
With git-flow extension:
Finishing a release branch
release branchManually:
With git-flow extension:
Hotfix branches
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>.
Hotfix steps (No PR)
Create a new local
hotfix/<branch-name>frommain.Work on the hotfix...
Merge to
mainand (developorrelease).Delete the
hotfix/<branch-name>.Tag the commit on
mainwith an updated version number.
Hotfix steps (With PR and Rulesets)
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>frommain.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>intodeveloporrelease.Create a new Release on GitHub with an updated
<patch>version number.On your local repository delete the
hotfix/<branch-name>.
Creating hotfix branches
hotfix branchesManually:
With git-flow extension:
Finishing a hotfix branch
hotfix branchManually:
With git-flow extension:
Last updated