Understanding the branching workflow
When you start using Git, you might be tempted to push all your code directly to the master
branch. This might not be very good for multiple reasons, one of them being that you can't experiment with new features very well as you pushed everything to master
. You can't simply delete the branch and start over.
The branching workflow tries to solve this by making sure that the master
branch is always the latest stable code, and it has to be deployable at all time. So, only code that has been tested and proven to work can go in there.
Let me explain this a bit further.
When you start working on a new feature, you create a new branch, which is named after the feature you're working on. This branch is separate from the master
branch as that is the latest stable version of the code. You directly push this new branch to GitLab and create a merge request for it. This way, your team knows what you're working on, and it allows them to comment on...