From e0eb45c96813644d8eb19d630c77c315075639b5 Mon Sep 17 00:00:00 2001 From: Denis Novikov Date: Wed, 3 May 2017 19:59:47 +0300 Subject: [PATCH 1/4] Create gitignore list --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c411f59 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# IDE Configs +.idea \ No newline at end of file From 3862af3d5542f2cd0add140225a1003c9d551c4d Mon Sep 17 00:00:00 2001 From: Denis Novikov Date: Wed, 3 May 2017 20:00:39 +0300 Subject: [PATCH 2/4] Updated file extension --- README.markdown => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README.markdown => README.md (100%) diff --git a/README.markdown b/README.md similarity index 100% rename from README.markdown rename to README.md From 9413ccd0427c16103a98cf5adbb4108bfb49f857 Mon Sep 17 00:00:00 2001 From: Denis Novikov Date: Wed, 3 May 2017 20:36:20 +0300 Subject: [PATCH 3/4] Update readme --- README.md | 231 +++++++++++++++++++++++++++--------------------------- 1 file changed, 116 insertions(+), 115 deletions(-) diff --git a/README.md b/README.md index d3d86ca..3741e80 100644 --- a/README.md +++ b/README.md @@ -1,166 +1,167 @@ -# Git Flow by example using GitHub # +# Git Flow by example using GitHub -## Initial Setup ## +## Initial Setup We start with this -![network-1](http://github.com/eadz/Git-Flow-Example/raw/develop/images/network-1.png "Initial Commit Network Image") +![network-1](images/network-1.png "Initial Commit Network Image") - ➜ Git-Flow-Example git:(master) git flow init +```bash +➜ Git-Flow-Example git:(master) git flow init - Which branch should be used for bringing forth production releases? - - master - Branch name for production releases: [master] - Branch name for "next release" development: [develop] +No branches exist yet. Base branches must be created now. +Branch name for production releases: [master] +Branch name for "next release" development: [develop] - How to name your supporting branch prefixes? - Feature branches? [feature/] - Release branches? [release/] - Hotfix branches? [hotfix/] - Support branches? [support/] - Version tag prefix? [] - -Then after pushing the develop branch to github, we get this: +How to name your supporting branch prefixes? +Feature branches? [feature/] +Bugfix branches? [bugfix/] +Release branches? [release/] +Hotfix branches? [hotfix/] +Support branches? [support/] +Version tag prefix? [] +``` -![network-2](http://github.com/eadz/Git-Flow-Example/raw/develop/images/network-2.png "After git flow init") +Then after pushing the develop branch to github, we get this: -## Releasing The Development Version ## +![network-2](images/network-2.png "After git flow init") -### Release branches ### -**May branch off from:** develop -**Must merge back into:** develop and master -**Branch naming convention:** release-* +## Release branches -So far, we have been working on the development version. -Even though this post isn't production ready, I'm going to make a release branch using git flow. +* **May branch off from:** develop +* **Must merge back into:** develop and master +* **Branch naming convention:** release-* - ➜ Git-Flow-Example git:(develop) git flow release start v0.1 - Switched to a new branch 'release/v0.1' +So far, we have been working on the development version. +Even though this post isn't production ready, I'm going to make a release branch using git flow. - Summary of actions: - - A new branch 'release/v0.1' was created, based on 'develop' - - You are now on branch 'release/v0.1' +```bash +➜ Git-Flow-Example git:(develop) git flow release start v0.1 +Switched to a new branch 'release/v0.1' - Follow-up actions: - - Bump the version number now! - - Start committing last-minute fixes in preparing your release - - When done, run: +Summary of actions: +- A new branch 'release/v0.1' was created, based on 'develop' +- You are now on branch 'release/v0.1' - git flow release finish 'v0.1' +Follow-up actions: +- Bump the version number now! +- Start committing last-minute fixes in preparing your release +- When done, run: -When creating a release branch, it uses the current state of 'develop' branch as its base. You can make any further small commits to make it production ready, then you can run `git flow release finish 'v0.1'` to finish the release. + git flow release finish 'v0.1' +``` -When the release is finished, the release branch will be merged to master. +When creating a release branch, it uses the current state of 'develop' branch as its base. You can make any further small commits to make it production ready, then you can run `git flow release finish 'v0.1'` to finish the release. +When the release is finished, the release branch will be merged to master. -## Git flow feature example ## +## Feature branches -### Release branches ### -**May branch off from:** develop -**Must merge back into:** develop and master -**Branch naming convention:** release-* +* **May branch off from:** develop +* **Must merge back into:** develop +* **Branch naming convention:** feature/feature_name -### Feature branches ### -**May branch off from:** develop -**Must merge back into:** develop -**Branch naming convention:** feature/feature_name +Feature branches are where you'll do most of your work. This chapter is a feature branch. You make your changes, and commit to the branch, and when the branch is ready, it will be merged back into develop. -Feature branches are where you'll do most of your work. This chapter is a feature branch. You make your changes, and commit to the branch, and when the branch is ready, it will be merged back into develop. +```bash +➜ Git-Flow-Example git:(develop) git flow feature start feature_example +Switched to a new branch 'feature/feature_example' - ➜ Git-Flow-Example git:(feature/feature_example) ✗ git flow feature help - Branches 'develop' and 'origin/develop' have diverged. - And local branch 'develop' is ahead of 'origin/develop'. - Switched to a new branch 'feature/feature_example' +Summary of actions: +- A new branch 'feature/feature_example' was created, based on 'develop' +- You are now on branch 'feature/feature_example' - Summary of actions: - - A new branch 'feature/feature_example' was created, based on 'develop' - - You are now on branch 'feature/feature_example' +Now, start committing on your feature. When done, use: - Now, start committing on your feature. When done, use: + git flow feature finish feature_example - git flow feature finish feature_example +``` There are quite a few options for git flow feature. You can find them buy running `git flow feature help`: - git flow feature help - usage: git flow feature [list] [-v] - git flow feature start [-F] [] - git flow feature finish [-rF] - git flow feature publish - git flow feature track - git flow feature diff [] - git flow feature rebase [-i] [] - git flow feature checkout [] - git flow feature pull [] +```bash +git flow feature help +usage: git flow feature [list] [-v] + git flow feature start [-F] [] + git flow feature finish [-rF] + git flow feature publish + git flow feature track + git flow feature diff [] + git flow feature rebase [-i] [] + git flow feature checkout [] + git flow feature pull [] +``` If we push a feature branch to GitHub without releasing it(`git push origin feature/feature_example`), the network graph looks like this: -![network-newfeature](http://github.com/eadz/Git-Flow-Example/raw/develop/images/network-newfeature.png "After pushing feature branch") +![network-newfeature](images/network-newfeature.png "After pushing feature branch") Once we release the feature by running `git flow feature finish feature_example`, the changes on the feature branch are merged back into the **develop** branch, but not the master branch. - ➜ Git-Flow-Example git:(feature/feature_example) git flow feature finish feature_example - Switched to branch 'develop' - Merge made by recursive. - README.markdown | 56 +++++++++++++++++++++++++++++++++++++++++ - images/network-newfeature.png | Bin 0 -> 14738 bytes - 2 files changed, 56 insertions(+), 0 deletions(-) - create mode 100644 images/network-newfeature.png - Deleted branch feature/feature_example (was 5b99b47). - - Summary of actions: - - The feature branch 'feature/feature_example' was merged into 'develop' - - Feature branch 'feature/feature_example' has been removed - - You are now on branch 'develop' +```bash +➜ Git-Flow-Example git:(feature/feature_example) git flow feature finish feature_example +Switched to branch 'develop' +Update 37fcbd1..be88604 +Fast-forward + README.md | 56 +++++++++++++++++++++++++++++++++++++++++ + images/network-newfeature.png | Bin 0 -> 14738 bytes + 2 files changed, 56 insertions(+), 0 deletions(-) + create mode 100644 images/network-newfeature.png +Deleted branch feature/feature_example (was be88604). + +Summary of actions: +- The feature branch 'feature/feature_example' was merged into 'develop' +- Feature branch 'feature/feature_example' has been locally deleted +- You are now on branch 'develop' +``` Once the develop branch is pushed to GitHub, network graph looks like this: -![network-after-feature-merge](http://github.com/eadz/Git-Flow-Example/raw/develop/images/network-after-feature-merge.png "After pushing merging") - - -Now it's time for another release - - ➜ Git-Flow-Example git:(release/v0.2) git flow release finish v0.2 - Switched to branch 'master' - Merge made by recursive. - README.markdown | 66 ++++++++++++++++++++++++++++++++ - images/network-after-feature-merge.png | Bin 0 -> 15281 bytes - images/network-newfeature.png | Bin 0 -> 14738 bytes - 3 files changed, 66 insertions(+), 0 deletions(-) - create mode 100644 images/network-after-feature-merge.png - create mode 100644 images/network-newfeature.png - Switched to branch 'develop' - Merge made by recursive. - README.markdown | 18 ++++++++++++++---- - images/network-after-feature-merge.png | Bin 0 -> 15281 bytes - 2 files changed, 14 insertions(+), 4 deletions(-) - create mode 100644 images/network-after-feature-merge.png - Deleted branch release/v0.2 (was 62426bf). - - Summary of actions: - - Latest objects have been fetched from 'origin' - - Release branch has been merged into 'master' - - The release was tagged 'v0.2' - - Release branch has been back-merged into 'develop' - - Release branch 'release/v0.2' has been deleted +![network-after-feature-merge](images/network-after-feature-merge.png "After pushing merging") + +Now it's time for another release + +```bash +➜ Git-Flow-Example git:(release/v0.2) git flow release finish v0.2 +Switched to branch 'master' +Merge made by recursive. + README.markdown | 66 ++++++++++++++++++++++++++++++++ + images/network-after-feature-merge.png | Bin 0 -> 15281 bytes + images/network-newfeature.png | Bin 0 -> 14738 bytes + 3 files changed, 66 insertions(+), 0 deletions(-) + create mode 100644 images/network-after-feature-merge.png + create mode 100644 images/network-newfeature.png +Switched to branch 'develop' +Merge made by recursive. + README.markdown | 18 ++++++++++++++---- + images/network-after-feature-merge.png | Bin 0 -> 15281 bytes + 2 files changed, 14 insertions(+), 4 deletions(-) + create mode 100644 images/network-after-feature-merge.png +Deleted branch release/v0.2 (was 62426bf). + +Summary of actions: +- Latest objects have been fetched from 'origin' +- Release branch has been merged into 'master' +- The release was tagged 'v0.2' +- Release branch has been back-merged into 'develop' +- Release branch 'release/v0.2' has been deleted +``` Note in the above description of what happened - Release branch has been merged into 'master' and Release branch has been back-merged into 'develop' -If we want others to have access to the release on GitHub, we need to push both master and develop branches. +If we want others to have access to the release on GitHub, we need to push both master and develop branches. After pushing the develop branch with `git push origin develop` : -![network-after-push-development](http://github.com/eadz/Git-Flow-Example/raw/develop/images/network-after-push-development.png) +![network-after-push-development](images/network-after-push-development.png) After pushing the master branch with `git push origin master` : -![network-after-push-master](http://github.com/eadz/Git-Flow-Example/raw/develop/images/network-after-push-master.png) - - -## Further Resources ## +![network-after-push-master](images/network-after-push-master.png) -*[A successful Git branching model](http://nvie.com/git-model) -*[Git Flow](http://github.com/nvie/gitflow) +## Further Resources +* [A successful Git branching model](http://nvie.com/git-model) +* [Git Flow](http://github.com/nvie/gitflow) This tutorial was created by [Eaden McKee](http://www.eadz.co.nz/) and licensed [Creative Commons by-nc-sa](http://creativecommons.org/licenses/by-nc-sa/3.0/nz/) \ No newline at end of file From 89de022975b7e91426606c874fdf1eb0d618fe35 Mon Sep 17 00:00:00 2001 From: Denis Novikov Date: Wed, 3 May 2017 20:56:59 +0300 Subject: [PATCH 4/4] Update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3741e80..8d42999 100644 --- a/README.md +++ b/README.md @@ -163,5 +163,6 @@ After pushing the master branch with `git push origin master` : * [A successful Git branching model](http://nvie.com/git-model) * [Git Flow](http://github.com/nvie/gitflow) +* [Git Flow Cheatsheet](http://danielkummer.github.io/git-flow-cheatsheet/) | Thanks [Denis Novikov](https://github.com/denisnovikov) This tutorial was created by [Eaden McKee](http://www.eadz.co.nz/) and licensed [Creative Commons by-nc-sa](http://creativecommons.org/licenses/by-nc-sa/3.0/nz/) \ No newline at end of file