I've been reading this popular document over and over to try and draft my own git workflow.
I think I have got it down, but I am still a little lost. Here is my current understanding...
We have two branches that will always remain active.
- Master: This is where I will push code that will actually be deployed to my production server and be used by my users.
- Development: This will be branched from the master branch. It will include all my new features, bug fixes etc that will be pushed into the next release.
We have multiple topic branches that will be branched from the development branch (I think). Once the topic, example the bug as been fixed, we merge that branch back into the development branch. Some examples:
- Topic Branch 1: feature-ajaxify-shoping-cart
- Topic Branch 2: bugfix-navbar-font-overlapping
Prepare The Release
- We have 1 release branch at a time that will be branched from the feature branch.
- Now we pull/merge all the features, bug fixes etc we want to push into the next release.
- We can leave some features we have been working on that wont be in the next release (I think).
Creating The Release
- Once satisfied with the releases, we can then merge that release branch into the master branch, and name the commit something like 'v1.2.0'.
- We also want to tag that commit with 'v1.2.0' so we can easily go back in time and see releases.
Side notes I have learned
The master branch is always nice and clean, and only contains commits that are releases (I think thats why we have a separate release branch, right?).
Please let me know where I have messed up or misinterpreted something etc. Thanks!