This is a draft cheat sheet. It is a work in progress and is not finished yet.
The main branches
master |
master is the main branch in which the source code of HEAD always has a production-ready state. |
develop |
develop is the main branch in which the source code of HEAD always represents a state with the latest development changes shipped for the next release. |
Each time when changes are merged back into master, this is a new production release by definition. We tend to be very strict at this, so that theoretically, we could use a Git hook script to automatically build and roll-out our software to our production servers everytime there was a commit on master.
Create a develop branch
git checkout -b develop |
git push origin develop |
|
|
Creating a feature branch
git checkout -b myfeature develop |
Incorporating a finished feature on develop
git checkout develop switch to branch 'develop' |
git merge --no-ff myfeature
|
git branch -d myfeature Deleted branch myfeature |
git push origin develop
|
Creating a release branch
git checkout -b release-1.2 develop switch to a new branch "release-1.2" |
./bump-version.sh 1.2 Files modified successfully, version bumped to 1.2. |
git commit -a -m "Bumped version number to 1.2" [release-1.2 74d9424] Bumped version number to 1.2 1 files changed, 1 insertions(+), 1 deletions(-) |
|