GIT: Team Work and Workflow, Git Flow, Github Flow, GitLab Flow
Team Work
The Pull Request
This is used in order to contribute to projects when you don’t own them and, therefore, lack the necessary permissiones to push your commits and contribute to the project. Or in other words, it's a request from the owner of a repository fork to the owner of said repository to incoporate all commits included in said fork into the repository.
Real life case
I discover a bug in a repository I don’t own. I want to modify it but, as I don’t own it, I will need to follow a series of steps in order to suggest that change:
1. Fork the repository in order to have it in my remote (this will clone the repository into my remote)
2. Clone repository to my local
3. Make relevant changes
4. Commit
5. Push (this will push changes from my local repository to my remote repository for which I have the necessary permissions)
6. Pull request will tell the owner of the repository that I am suggesting him certain changes. I can also mark it as a draft in order to warn them that I am still working on it. Another useful option would be enabling the owners of said repository to edit this Pull Request.
Team Workflow
Labels
Don’t confuse them with tags (which are semantic keywords associated with commits).
Labels are keywords associated with issues or pull requests. This labels can be modified inside of Issues Tab, on the top part of the section next to Milestones.
For example:
• To do (Assignee)
• In progress (Assignee)
• To review (Reviewer)
• Accepted (Reviewer)
• Changes Requested (Reviewer)
The problem with this system is we are using labels for something they were not intended for, and we risk mixing abstraction levels. For example, we could have labels for completion levels (in progress, to review, etc) and labels referred to semantic descriptions like default ones (bug, enhancement, refactor).
Github Projects
This progress can also be defined within Github projects. Each new feature is a new project inside of which we can define the above mentioned status (To do, In progress, etc). Another advantage is being able to automate the kanban (system of columns) in our project. For example, everytime I close an issue I can automate the process so that it transfers to "For Review" column. The downside of this system though, is when using other Project Management Tools like Jira, it might make no sense to maintain this information twice.
PR Status
Another solution is creating a Pull Request as a Draft, that will not notify the reviewers of my pull request, but it will allow them see that I am working on something before I am close to completing my task.
Git Flow
Branches are free! They cost nothing, so basically you start with two:
- master > ready for production
- develop > where we place code for the next version of the project
- hotfixes > bug fixing
- pre-production
- version 2.0
- Master > Ideally only code ready for production
- Develop > Every now and then merged into Master
- Feature > It originates from develop and is merged into Develop. This branch is used to develop new features or functionalities within our app.
- Release > It originates from develop and is merged into Develop and Master. This branch is used for the next code in production. This is for bug fixes and minor adjustments before production.
- Hotfix > It originates from master and is merged into Develop and Master. It is used to correct production code.
- Create a new branch
- Create and implement code
- Merge into relevant branch (Develop and/or Master).
- Close Branch
GitHub Flow
- Main/Master > Ideally only code ready for production. All of other branches are born from this.
- Feature/Hotfix
GitLab Flow
- Main/Master
- Feature/Hotfix > Changes merged into Pre-production or Production are made through cherry-picks in the case of bugfixes
- Pre-production > Updated from Master through Merge Requests (the equivalent to Pull Request in GitHub).
- Production
Comments
Post a Comment