Repository navigation
Branch Management
Note
Make sure that you are always in sync with the main branch. Regularly merge changes from main into develop. This keeps develop up to date with the latest stable code and ensures that any work done in develop is built on top of the latest changes in main.
- Ensure main is up to date: Before syncing develop with main, make sure you have the latest changes from main.
- Merge main into develop: Once main is updated, merge it into develop to bring all new changes into the development branch.
- Resolve conflicts: If there are conflicts during the merge, resolve them before committing.
- Test the code: After merging, ensure everything works properly in develop before continuing development.
# Step 1: Switch to the 'main' branch
git checkout main
# Step 2: Pull the latest changes from the remote repository
git pull origin main
# Step 3: Switch to the 'develop' branch
git checkout develop
# Step 4: Merge 'main' into 'develop'
git merge main
# Step 5: Resolve any merge conflicts if necessary
# Step 6: Push the updated 'develop' branch to the remote repository
git push origin develop
The Develop branch is the main branch for ongoing development. Features are developed in separate branches and merged into develop after they are completed and tested.
-
Create a feature branch from
develop: All new features should branch off fromdevelop. - Develop and test: Perform development work in the feature branch, ensuring that it is fully tested.
-
Merge back into
develop: Once the feature is complete and tested, merge it back into thedevelopbranch.
# Ensure your 'develop' branch is up to date
git checkout develop
git pull origin develop
# Create a new feature branch from 'develop'
git checkout -b feature/new-feature
# Apply your development changes, bug fixes, or new features
# Stage and commit your changes
git add .
npx git-cz # Commitizen for standardized commit messages
# Push the feature branch to GitHub
git push origin feature/new-feature# Switch back to 'develop'
git checkout develop
git pull origin develop
# Merge your feature branch into 'develop'
git merge feature/new-feature
# Push the updated 'develop' branch to GitHub
git push origin developImportant
Always keep develop up to date: Regularly pull the latest changes from develop to avoid conflicts.
Feature branches: All new work should be done in a feature branch and merged into develop once complete.
Stable codebase: Ensure all code merged into develop is stable and has been tested.
Note
Naming convention for branches should follow the format: alpha/scope-feature-name. For more details, click here.
The Feature branch workflow is used for working on individual features or tasks before merging them back into the develop branch. Each new feature or bug fix should be developed in its own feature branch, which is then merged into develop once the feature is complete and tested.
-
Create a new feature branch from
develop: All feature development should branch off fromdevelop. - Develop and test your feature: Perform development work in the feature branch.
-
Regularly pull updates from
develop: Keep your feature branch in sync withdevelopto avoid conflicts. -
Merge the feature back into
develop: After the feature is completed and tested, merge it back intodevelop. - Clean up the feature branch: Once merged, the feature branch can be deleted.
Before you start developing a new feature, create a new branch from develop.
# Ensure your 'develop' branch is up to date
git checkout develop
git pull origin develop
# Create a new feature branch
git checkout -b feature/my-new-featureMake changes to your code, implement the feature, and test it thoroughly within this branch.
# Make your changes
# Stage and commit your changes
git add .
npx git-cz # Use Commitizen to standardize commit messages
# Push your feature branch to the remote repository
git push origin feature/my-new-featureWhile developing, regularly pull the latest changes from develop to keep your feature branch up to date and avoid conflicts later.
# Pull the latest changes from 'develop' and merge into your feature branch
git pull origin develop
# Resolve any conflicts and commit changes
git add .
npx git-cz
Once the feature is fully developed and tested, it’s time to merge it back into develop.
# Switch back to the 'develop' branch
git checkout develop
git pull origin develop
# Merge your feature branch into 'develop'
git merge feature/my-new-feature
# Push the updated 'develop' branch to the remote repository
git push origin developAfter successfully merging the feature into develop, you can delete the feature branch locally and remotely to keep the repository clean.
# Delete the feature branch locally
git branch -d feature/my-new-feature
# Delete the feature branch from the remote repository
git push origin --delete feature/my-new-featureThe Feature Testing Branch is used to test a feature before merging it into develop. It is a branch created from the feature branch, allowing isolated testing without affecting the main develop branch. This helps catch bugs or issues before the feature is finalized.
- Create a feature testing branch from the feature branch: This branch is created specifically for testing a new feature.
- Test the feature: Perform tests, fix bugs, and ensure the feature is stable.
- Merge back into the feature branch: Once testing is complete, merge any fixes back into the original feature branch.
-
Continue the standard feature workflow: After testing, follow the normal process to merge the feature back into
develop.
After developing a feature, create a new testing branch from your feature branch to start testing the feature.
# Ensure you're on the feature branch and it is up to date
git checkout feature/my-new-feature
git pull origin feature/my-new-feature
# Create a new feature testing branch from the feature branch
git checkout -b feature/test-my-new-featureRun tests, identify bugs, and make necessary fixes in the feature testing branch. Once the testing is complete and any bugs have been resolved, commit and push the changes.
# Make changes or bug fixes
# Stage and commit changes
git add .
npx git-cz # Use Commitizen for standardized commit messages
# Push the feature testing branch to the remote repository
git push origin feature/test-my-new-feature
Once the feature testing is complete and all issues have been resolved, merge the feature testing branch back into the original feature branch.
# Switch back to the feature branch
git checkout feature/my-new-feature
git pull origin feature/my-new-feature
# Merge the testing branch into the feature branch
git merge feature/test-my-new-feature
# Push the updated feature branch to the remote repository
git push origin feature/my-new-featureAfter merging the testing branch into the feature branch, continue the normal feature workflow, including merging the feature into develop after testing is complete.
# Switch to 'develop' branch
git checkout develop
git pull origin develop
# Merge the feature branch into 'develop'
git merge feature/my-new-feature
# Push the updated 'develop' branch to the remote repository
git push origin developAfter merging the feature testing branch into the feature branch, delete the feature testing branch to keep the repository clean.
# Delete the feature testing branch locally
git branch -d feature/test-my-new-feature
# Delete the feature testing branch from the remote repository
git push origin --delete feature/test-my-new-featureThe Alpha branch is used for testing new features after initial development in the feature branch and before final testing in the beta branch. This branch is created from develop and serves as a testing environment to identify and resolve bugs before moving forward.
-
Create an
alphabranch fromdevelop: After completing development in the feature branch and merging it intodevelop, create analphabranch for testing. -
Perform alpha testing: Test and identify bugs within the
alphabranch. Apply fixes and improvements. -
Merge back into
develop: After successful alpha testing, merge thealphabranch back intodevelopor proceed tobetafor final testing. -
Prepare for beta testing: Once alpha testing is complete and the feature is stable, create a
betabranch for further testing.
After merging the feature into develop, create a new alpha branch to begin testing.
# Ensure your 'develop' branch is up to date
git checkout develop
git pull origin develop
# Create a new alpha branch from 'develop'
git checkout -b alpha/new-featureTest the feature in the alpha branch and apply bug fixes or improvements as needed. Commit and push the changes after testing.
# Make changes or bug fixes
# Stage and commit changes
git add .
npx git-cz # Use Commitizen for standardized commit messages
# Push the alpha branch to the remote repository
git push origin alpha/new-feature
Once testing is complete and the feature is stable, merge the alpha branch back into develop or move forward to the beta branch.
# Switch to the 'develop' branch
git checkout develop
git pull origin develop
# Merge the alpha branch into 'develop'
git merge alpha/new-feature
# Push the updated 'develop' branch to the remote repository
git push origin develop
After merging the changes back into develop, create a beta branch from develop for final testing.
# Switch to 'develop' and create a new beta branch
git checkout develop
git pull origin develop
git checkout -b beta/new-feature
# Push the beta branch to the remote repository
git push origin beta/new-feature
Once the alpha branch has been merged into develop or moved to beta, you can delete the alpha branch to maintain a clean repository.
# Delete the alpha branch locally
git branch -d alpha/new-feature
# Delete the alpha branch from the remote repository
git push origin --delete alpha/new-feature
Note
If you discover bugs during the alpha or beta testing phases, create a specific bug-fixing branch from the respective branch. This ensures that all bug fixes are managed in an isolated environment without affecting the main feature development. Once the bug is fixed, merge the bug-fixing branch back into the original alpha or beta branch.
Example:
# Create a bug-fixing branch from alpha
git checkout alpha/new-feature
git pull origin alpha/new-feature
git checkout -b alpha/bug-feature-new
# Apply bug fixes, then stage, commit, and push changes
git add .
npx git-cz
git push origin alpha/bug-feature-new
# Merge the bug-fixing branch back into alpha after fixes
git checkout alpha/new-feature
git merge alpha/bug-feature-new
git push origin alpha/new-feature
# Clean up the bug-fixing branch
git branch -d alpha/bug-feature-new
git push origin --delete alpha/bug-feature-newThe Beta branch is used for final testing before a feature or release is merged into the main branch. This branch is created from alpha and serves as the final checkpoint for quality assurance and pre-release testing. Once everything is verified, the beta branch is merged into main, and the release can be made public.
-
Create a
betabranch fromalpha: Oncealphatesting is complete, create abetabranch for final testing. -
Perform beta testing: Conduct thorough testing and final bug fixes in the
betabranch. -
Merge
betaintomain: After successful testing, merge thebetabranch intomainfor release. -
Update
develop: After releasing tomain, ensuredevelopis updated with any changes frombeta.
After testing and fixing issues in the alpha branch, create a beta branch for final testing.
# Ensure you're on the alpha branch and it is up to date
git checkout alpha/new-feature
git pull origin alpha/new-feature
# Create a new beta branch from the alpha branch
git checkout -b beta/new-featureTest the feature in the beta branch, applying any final bug fixes or adjustments as needed. Once the feature is stable and fully tested, commit your changes.
# Make final adjustments or bug fixes
# Stage and commit changes
git add .
npx git-cz # Use Commitizen for standardized commit messages
# Push the beta branch to the remote repository
git push origin beta/new-featureOnce beta testing is complete and the feature is ready for release, merge the beta branch into main for production deployment.
# Switch to the 'main' branch
git checkout main
git pull origin main
# Merge the beta branch into 'main'
git merge beta/new-feature
# Push the updated 'main' branch to the remote repository
git push origin main
After the beta branch has been merged into main, it's important to update the develop branch with any changes made during beta testing.
# Switch to the 'develop' branch
git checkout develop
git pull origin develop
# Merge the beta branch into 'develop' to ensure it's up to date
git merge beta/new-feature
# Push the updated 'develop' branch to the remote repository
git push origin develop
Once the beta branch has been merged into both main and develop, you can delete the beta branch to keep the repository clean.
# Delete the beta branch locally
git branch -d beta/new-feature
# Delete the beta branch from the remote repository
git push origin --delete beta/new-feature
Note
If you discover bugs during the alpha or beta testing phases, create a specific bug-fixing branch from the respective branch. This ensures that all bug fixes are managed in an isolated environment without affecting the main feature development. Once the bug is fixed, merge the bug-fixing branch back into the original alpha or beta branch.
Example:
# Create a bug-fixing branch from beta
git checkout beta/new-feature
git pull origin beta/new-feature
git checkout -b beta/bug-feature-new
# Apply bug fixes, then stage, commit, and push changes
git add .
npx git-cz
git push origin beta/bug-feature-new
# Merge the bug-fixing branch back into beta after fixes
git checkout beta/new-feature
git merge beta/bug-feature-new
git push origin beta/new-feature
# Clean up the bug-fixing branch
git branch -d beta/bug-feature-new
git push origin --delete beta/bug-feature-newNote
Naming convention for branches should follow the format: alpha/scope-feature-name. For more details, click here.
Home | Todo | Development | Release