-
Make sure you are in branch
develop
git checkout develop
-
Make sure
develop
branch is up to date from origin:git pull origin develop
-
Create a new release branch from
develop
:git checkout -b release/x.y.z
-
Make required changes like updating POM version and other required files. Once changes are in place, execute add and commit:
git add . git commit -m "POM version updated"
-
Push release branch to remote repository:
git push origin release/x.y.z
-
Deploy release branch in STAGE environment and execute required testing (QA test may include regression tests). This step considers all reviews and required functionality validations.
-
Once RELEASE CANDIDATE is approved and ready, merge it into
master
branch.git checkout master git pull origin master git merge --no-ff release/x.y.z
-
Create TAG to reference the new version in
master
:git tag -a x.y.z -m "Release version x.y.z"
-
Push changes and tag to remote repository:
git push origin master git push origin x.y.z
-
Once RELEASE CANDIDATE has been merged to
master
merge it todevelop
branch to incorporate changes.git checkout develop git pull origin develop git merge --no-ff release/x.y.z git push origin develop
-
Delete RELEASE branch:
git branch -d release/x.y.z git push origin --delete release/x.y.z
-
Make sure you are in branch
master
git checkout master
-
Make sure
master
branch is up to date from origin:git pull origin master
-
Create a new hotfix branch from
master
:git checkout -b hotfix/x.y.z
-
Make changes required to fix the issues. Apply required fixes in code. (Remember to update POM version) Then add and commit:
git add . git commit -m "Fix applied to solve (issue) x.y.z"
-
Push hotfox branch to remote repository:
git push origin hotfix/x.y.z
-
Publish hotfix in
STAGE
environment and execute required tests and validations to make sure hotfix is properly implemented. -
Merge hotfix into
master
branch:git checkout main git pull origin main git merge --no-ff hotfix/x.y.z
-
Create TAG of the new version in
master
branch:git tag -a x.y.z -m "Hotfix version x.y.z"
-
Push
master
andTAG
to remote repository:git push origin main git push origin x.y.z
-
Merge hotfix into
develop
branch to incorporate hotfix changes:git checkout develop git pull origin develop git merge --no-ff hotfix/x.y.z git push origin develop
-
Delete hotfix branch:
git branch -d hotfix/x.y.z git push origin --delete hotfix/x.y.z
-
Install `git-flow' tool
- macOS:
brew install git-flow
- Debian/Ubuntu:
sudo apt-get install git-flow
- Windows: You can install Git Flow using the Git for windows installer.This includes GitFlow as an option during installation.
- macOS:
-
Initialize Git-Flow in the target repository. Make sure you navigate to the GIT repository you want to use and execute the following command:
git flow init
Follow instructions displayed to set up main and support branches. By default, main branches are
main
anddevelop
.
-
Initialize a new release:
git flow release start x.y.z
This command will create a new
release
branch fromdevelop
branch. -
Execute requried changes and commit: Make required changes in code (i.e. update POM version) and commit those changes.
git add .git commit -m "POM version updated"
-
Push release branch to origin:
git push origin release/x.y.z
-
Deploy release in
STAGE
environment and make sure everything is working ok. Perform all required validations and tests. -
Finish release: Once RC is approved then it can be finished. To do that execute the following command:
git flow release finish x.y.z
This command will:
- Merge
release
branch intomaster
branch. - TAG of the new version in
master
- Merge
release
branch intodevelop
branch - Delete
release
branch
- Merge
-
Push changes to remote repository:
git push origin main git push origin develop git push origin --tags
-
Initialize a new hotfix:
git flow hotfix start x.y.z
This command will create a new
release
branch fromdevelop
branch. -
Make required changes and commit: Make required changes in code (remember to include updating the POM version) and commit:
git add . git commit -m "changes required - hotfix versión x.y.z"
-
Push hotfix to remote repository:
git push origin hotfix/x.y.z
-
Deploy release in
STAGE
environment and make sure everything is working ok. Perform all required validations and tests. -
Finish hotfix:
git flow hotfix finish x.y.z
This command will:
- Merge
hotfix
branch intomaster
branch. - TAG of the new version in
master
- Merge
hotfix
branch intodevelop
branch - Delete
release
branch
- Merge
-
Push changes to remote repository:
git push origin main git push origin develop git push origin --tags