Once the develop branch is tested and stable, software developers or release engineers will merge the develop branch to the master branch. The master branch is usually used to create the package that will be released to production and deployed on the production servers.
Besides the develop branch and master branch, we usually encounter other 4 types of repository branches.
1. Bugfix branches are typically used for fixing bugs against a release branch. Conventionally these branches are prefixed with bugfix/
2. Feature branches are typically from and merged back into the development branch, they often used for specific feature work. Conventionally these branches are prefixed with feature/.
Bugfix branches and feature branches are where developers check in code, create pull request, check in code review updates. This is a safe branch to experiment. Any mistake only effect this particular branch, won't effect other developers working on other branches. The bugfix and feature only start to effect other developers after they are merged to the development. Sometimes, more than one developers updated the same line of the develop branch in their bugfix or feature branches, there will be merge conflict. The developer merge his/her branch earlier won't have problem, the developer merges his/her branch later will get merge conflict at the time of command "git push".
The solution is to
- git checkout develop
- git pull
- git checkout bugfix/bugfixbranchname
- git pull
- git merge develop
At this point, the merge will fail, but the failure message will list all the files with conflict.
Go the files and manually fix the conflict lines, the
- git commit -am "solve conflict"
- git push
4. Release branches are typically branches from the develop branch and changes are merged back into the develop branch, they are used for release tasks and long-term maintenance. Some company use master branch as the release branch, then use tags to differentiate different releases. Some companies has multiple release branches names other than master. They conventionally are prefixed with release/.
No comments:
Post a Comment