I also ran into many problems for implementing git in my last project. After too many searches, I found this blog, and this is a really good way to support the git forking model.
Successful git branching model.
The central repo has two main branches with infinite lifetime:
The main branch at the beginning should be familiar to every git user. In parallel with the leading branch, there is another branch called develop.
We believe that origin / master is the main branch where the HEAD source code always reflects a state of readiness for production.
We believe that origin / develop is the main branch, where the HEAD source code always reflects the state with the latest development changes for the next release. Some would call this an "integration branch." Here you can create any automatic nightly builds.
Supporting branches
The different types of branches that we can use are as follows:
- function branches
- Disable branches
- Fixed branches
function branches : function branches (or sometimes called topic branches) are used to develop new functions for an upcoming or distant future version.
May depart from: development
Need to reunite: development
Branch naming convention: nothing but a wizard, development, release, or fix -
Disable branches . Disable support branches when preparing a new production version. They allow you to use the last minute point and cross ts.
May depart from: development
It is necessary to unite again: to develop and master
Branch naming convention: release - *
Fixed branches : patch branches are very similar to release branches, as they are also designed to prepare for a new production version, albeit unplanned. They arise from the need to act immediately in case of an undesirable state of a live version.
May depart from: master
It is necessary to unite again: to develop and master
Branch naming convention: fix - *
More information on this branching git model can be found on the blog. Commands used for the branching model are also listed on the blog. Check out the blog for more details. I have successfully implemented the branching model in my project with some changes from the model mentioned in the blog. git is a powerful and flexible tool, and this is just one way to use Git.