Git Workflow
Introduction
Our Git workflow serves as a guideline for how code changes flow through our system, from your local machine to our production environment. Adhering to this workflow ensures a smooth and consistent development process for everyone on the Alliance Business Suite (ABS) team.
Workflow Steps
1. Clone the Repository
Initially, you'll need to clone the ABS repository hosted on Azure DevOps.
git clone git@dev.azure.com:fenixalliance/ABS.git
2. Checkout to a New Branch
Always work on a separate branch when you're adding a feature, fixing a bug, or making some other kind of improvement. Check out to a new branch using:
git checkout -b <branch-name>
3. Make Changes Locally
Perform code changes, add new files, and generally make the code changes necessary for your task. After each significant change or logical commit point, stage and commit your changes.
git add .
git commit -m "Descriptive commit message"
4. Keep Your Branch Updated
It's crucial to regularly update your local branch with changes from the remote develop branch. This minimizes conflicts later on.
git fetch origin
git rebase origin/develop
5. Push Your Changes
After making your changes and committing them locally, push the changes to the remote repository.
git push origin <branch-name>
6. Open a Pull Request (PR)
Once your feature is complete and you've pushed your branch to Azure DevOps, create a Pull Request (PR) from the Azure DevOps portal.
- Source branch: Your feature branch
- Target branch:
develop(ormainfor hotfixes)
7. Code Review
Before your PR is merged, it will be reviewed by at least one other team member. Address any comments or requested changes during this phase.
8. Merge and Clean Up
Once the PR is approved, it will be merged into the target branch. After a successful merge, delete the feature branch from both your local environment and the remote repository.
git branch -d <branch-name>
git push origin --delete <branch-name>
Best Practices
- Always pull the latest changes from the
developbranch before starting any new work. - Keep your commits small and focused. Each commit should represent a single logical change.
- Write clear, concise commit messages.
- Resolve any conflicts as soon as possible.
- Ensure your code conforms to our style guidelines.
Conclusion
By adhering to this Git workflow, you contribute to maintaining an efficient and effective version control system that benefits everyone involved in the project.
For further understanding of our branching strategy, consult our Branching Strategy document.
Feel free to contribute to this document to keep it updated and relevant.