git:workflow_branching_strategy_and_release_management
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
git:workflow_branching_strategy_and_release_management [2016/11/21 11:24] – peter | git:workflow_branching_strategy_and_release_management [2019/11/29 15:15] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== GIT - Workflow, Branching Strategy, and Release Management ====== | ||
- | |||
- | Git repositories aren't technically centralized anywhere but you could refer to one as the " | ||
- | |||
- | Typically when you're coding, you're either building a new feature or fixing a bug. When both need to happen at once, that's when things get interesting. | ||
- | |||
- | Typically you'll have two main immortal branches. | ||
- | |||
- | * master | ||
- | * Contains an abridged version of the project | ||
- | * HEAD should always be production-ready | ||
- | * Make sure you tag each commit with a version number. | ||
- | |||
- | * development | ||
- | * Contains the entire history of the project | ||
- | * HEAD contains latest changes for next release (nightly builds) | ||
- | |||
- | Once source code in the development branch is stable, it is merged into master and tagged with a release number to represent a new production release. | ||
- | |||
- | **It's good practice to pull with**: git pull –rebase to avoid useless merge commits. | ||
- | |||
- | It's also good practice to initiate a pull request before merging into development/ | ||
- | |||
- | I recommend using this extension to make your life easier: https:// | ||
- | |||
- | ===== Version Naming Conventions ===== | ||
- | |||
- | * [Major version].[Minor version].[Build Number] | ||
- | * [Year].[Month].[Day].[Build] | ||
- | * Major.Minor.Hotfix | ||
- | |||
- | |||
- | ===== Support Branches ===== | ||
- | |||
- | These branches are typically broken into the following: | ||
- | |||
- | ==== Topic/ | ||
- | |||
- | __Flow__ | ||
- | |||
- | * Should only exist in the developer' | ||
- | * Branch off from development branch | ||
- | * Must be merged back into the development branch | ||
- | |||
- | __Create__ | ||
- | |||
- | * git checkout -b newfeature123 development | ||
- | |||
- | __Merge__ | ||
- | |||
- | * git checkout development | ||
- | * git merge –no-ff newfeature123 | ||
- | * It does create a empty commit object but the trade-off is worth it. We don't fast-forward because we want to keep historical information about the feature branch and all its commits that create the feature. | ||
- | * git branch -d newfeature123 | ||
- | * git push origin development | ||
- | |||
- | |||
- | ===== Release branches ===== | ||
- | |||
- | These branches are created once the development branch has all the required feature for the expected release. Release branches are great because it allows one team to polish up the release before it gets merged into the master while other teams could work on new features of a future release. It also allows an easy view of the preparation of the release. Once the branch is created, no additional features are allowed. These are allowed: | ||
- | |||
- | * bug fixes | ||
- | * documentation generation | ||
- | * other release-oriented tasks | ||
- | |||
- | It also helps Primarily prepares code for production release. Allows for last minute changes, minor bug fixes, and prepping version number, build dates, etc for release. The perfect time to branch off from development into a release branch is when all features targeted for the next release is merged into the development branch. Only when the release branch is created is a version number for the release is assigned. | ||
- | |||
- | __Flow__ | ||
- | |||
- | * Could branch off of the development branch | ||
- | * Merges back to develop and master branches | ||
- | * Naming convention: release-* | ||
- | |||
- | __Create__ | ||
- | |||
- | * git checkout -b release-1.3 development | ||
- | * git commit -am "Bump version number to 1.3” | ||
- | |||
- | __Merge__ | ||
- | |||
- | * git checkout master | ||
- | * git merge –no-ff release-1.3 | ||
- | * git tag -a 1.3 -m " | ||
- | * When merging to master, always tag. | ||
- | * git push –tags | ||
- | * Keep in mind annotated tags aren't tied to a specific branch, but are objects of their own with metadata. | ||
- | Tagger: John Doe & | ||
- | Date: Fri Aug 14 04:39:17 2015 +0000 | ||
- | First release with ICD-10 Support | ||
- | commit 1590c3a6b71232146192c8ab6dc3db5d79d8Merge: | ||
- | Author: John Doe & | ||
- | Date: Fri Aug 14 04:28:10 2015 +0000 | ||
- | Merge branch ' | ||
- | </ | ||
- | * git checkout develop | ||
- | * git merge –no-ff release-1.3 | ||
- | * This may introduce a merge conflict due to version change to which you fix and commit again. | ||
- | * git branch -d release-1.3 | ||
- | |||
- | |||
- | ===== Hotfix branches ===== | ||
- | |||
- | These are the only branches that could branch from master. | ||
- | |||
- | __Flow__ | ||
- | |||
- | * Branches off of master | ||
- | * Merges back into development and master | ||
- | * Naming convention: hotfix-* | ||
- | |||
- | __Create__ (Assuming fix is on version 1.3) | ||
- | |||
- | * git checkout -b hotfix-1.3.1 master | ||
- | * bump the version | ||
- | * git commit a-m "Bump version number to 1.3.1” | ||
- | * fix bug | ||
- | * git commit -m "Fix bug on production” | ||
- | |||
- | __Merge__ | ||
- | |||
- | * git checkout master | ||
- | * git merge –no-ff hotfix-1.3.1 | ||
- | * git tag -a 1.3 -m " | ||
- | * When merging to master, always tag. | ||
- | * git push –tags | ||
- | * git checkout development | ||
- | * git merge –no-ff hotfix-1.3.1 | ||
- | * Keep in mind if a release branch exists, the hotfix should be merged to that branch and not development. | ||
- | * git branch -d hotfix-1.3.1 | ||
- | |||
- | |||
git/workflow_branching_strategy_and_release_management.1479727457.txt.gz · Last modified: 2020/07/15 09:30 (external edit)