Developing Badaso LMS, Git Workflow
Working in teams can be tricky, and this project may not be my first, but I have survived enough merge conflicts to declare myself a Merge Warrior. Through these brain-scorching experiences, I have learned valuable lessons that I would like to inform you of so that you may not have to go through the same predicaments I did. Hence, I will be sharing my adventures in overcoming humane incompetence by familiarizing myself with Git Flow and its comrades.
Git
To start things, let’s get to know the git in git-flow. Git is a version control system used in development to keep track of the changes made to your source code. Version control here is something that holds onto different versions of a file throughout the development process. It keeps track of the changes made to a file, enabling you to revert to a specific version of that file, whether to undo a mistake or redo an implementation.
Git-flow
As for git-flow, it is a merge based solution to working in teams in developing a project. Git-flow is just one out of the many versions of Git Workflow, the general idea of git-flow branch management is the separation of the main branches into two branches: develop and master. Feature branches will merge into the develop branch once reviewed and approved, which could finally merge into the master branch once merge requests are accepted. This workflow enables developers to work simultaneously in different feature branches instead of the master branch risking conflicts.
To further elaborate, the main two branches exist with the objective that the master branch is used solely for production, as it stores the deployment history of the project. On the other hand, the develop branch is used during development, where features developed in their respective branches will be integrated. The develop branch acts as the parent branch of the feature branches, in which each feature separately has its own. Other than those mentioned, there are branches created for certain purposes, like the hotfix branch created to merge quick fixes to the Master branch, also the only branch that is allowed to fork and merge directly into the Master branch.
Git-flow Application
The git workflow used in the development of Badaso LMS is somewhat as previously explained, although we made adjustments in the naming of the branches. Our production branch is called main instead of master, and our development branch is called staging instead of develop. The naming template for our feature branch is PBI-[pbi_id]-[task_name], as an example the feature branch I am currently working on is called PBI-3-view_class. There were discussions of creating an umbrella branch, an epic branch, where for example PBI-3-view_class and PBI-4-create_class would belong to the same epic branch, class. This has yet to be implemented.
Glossary
- Merge request is something that is created when code made in a feature branch is to be merged to a main branch or when the development branch is to be merged to the production branch.
- Code review is the process of checking a developer’s code done by other developers in the team or at least one of the reviewers should not be the author of the code.
I hope you find this article helpful, if you find any mistakes or misinformation, I would very much appreciate the feedback. Thank you!
References