Git Workflow
Git branch strategies
Section titled “Git branch strategies”Part 1
Section titled “Part 1”New feature / Known bug workflow
Section titled “New feature / Known bug workflow”- From an issue in gitlab, find the
Create merge requestbutton. This creates a branch with the name of the issue - In you editor,
fetchthe repos with this new branchgit fetch --all - Switch to this branch
git checkout <name-of your-branch>
Degraded workflow (quick fix)
Section titled “Degraded workflow (quick fix)”- Switch to a new branch
git checkout -b <name-of-the-new-branch> - Push this new branch to the server
git push --set-upstream origin $(git_current_branch)
Part 2
Section titled “Part 2”- Make your changes
- Add them to the staging area
# Add each filegit add <name-of-the-file-to-commit> <name-of-the-file-to-commit-2># or add every file that changedgit add --all- Commit them
git commit --message "fix: fix the slider"(please follow the conventional commit convention when writing your commit message) - Go to github / gitlab’s interface and merge from there.
- Feature / bug: everything is already in place
- Quick Fix: you’ll see a
Create merge requestbutton (related to your branch name). Alternatively, go the to branches section of gitlab, find your branch and click theNew(merge request).
- Ensure that all the checks of the CI pipeline pass
- Merge the content of your branch into
main - In you editor switch to the
mainbranchgit checkout main - Pull
git pull
Changing git workflow
Section titled “Changing git workflow”The following strategies are the most popular strategies used. In order of complexity, they are:
- GitHub Flow Guide & GitHub Flow
- GitLab Flow Guide
- GitFlow by Vincent Driessen (Original blog post) & GitFlow on GitHub
GitFlow Branch Strategy
Section titled “GitFlow Branch Strategy”- Overview: GitFlow is a branching model that defines a strict branching structure.
- Branches:
- main: Represents production-ready code.
- develop: Integration branch for ongoing development.
- feature: Individual features developed in separate branches.
- release: Prepares for a new production release.
- hotfix: Addresses critical issues in the production code.
- Workflow: Features merge into develop, releases merge into main and develop, hotfixes merge into main and develop.
- Pros: Well-defined structure, suitable for larger projects.
- Cons: Can be complex for smaller projects, and feature branches may lead to longer development cycles.
GitFlow cheatsheet & tool (avh)

GitHub Flow Branch Strategy
Section titled “GitHub Flow Branch Strategy”- Overview: GitHub Flow is a lightweight, simplified branching model.
- Branches:
- main: Represents the main development line.
- feature: Features developed in individual branches.
- Workflow: Developers create feature branches, open pull requests for discussion, and merge directly into the main branch after review.
- Pros: Simple and streamlined, encourages continuous delivery.
- Cons: May not be suitable for complex release management.
GitLab Flow Branch Strategy
Section titled “GitLab Flow Branch Strategy”- Overview: GitLab Flow is similar to GitHub Flow with a focus on CI/CD and collaboration.
- Branches:
- main: Represents the main development line.
- feature: Features developed in individual branches.
- Production: Represents the production-ready code.
- Workflow: Developers create feature branches, open merge requests for discussion, and merge into the main and production branches after review.
- Pros: Emphasizes CI/CD, seamless collaboration, and production tracking.
- Cons: May require additional setup for CI/CD pipelines.