Last active
April 4, 2018 13:26
-
-
Save queirozsc/934d6396114e20cfbc36442abc50e641 to your computer and use it in GitHub Desktop.
Git branching model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout -b myfeature develop #Switched to a new branch "myfeature" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout develop #Switched to branch 'develop' | |
git merge --no-ff myfeature #Updating ea1b82a..05e9557 .. (Summary of changes) | |
git branch -d myfeature #Deleted branch myfeature (was 05e9557). | |
git push origin develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout -b release-1.2 develop #Switched 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(-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout master #Switched to branch 'master' | |
git merge --no-ff release-1.2 #Merge made by recursive... (Summary of changes) | |
git tag -a 1.2 | |
### To keep the changes made in the release branch, we need to merge those back into develop, though | |
git checkout develop #Switched to branch 'develop' | |
git merge --no-ff release-1.2 #Merge made by recursive... (Summary of changes) | |
### Now we are really done and the release branch may be removed, since we don’t need it anymore: | |
git branch -d release-1.2 #Deleted branch release-1.2 (was ff452fe) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout -b hotfix-1.2.1 master #Switched to a new branch "hotfix-1.2.1" | |
./bump-version.sh 1.2.1 #Files modified successfully, version bumped to 1.2.1. | |
git commit -a -m "Bumped version number to 1.2.1" #[hotfix-1.2.1 41e61bb] Bumped version number to 1.2.1 ... 1 files changed, 1 insertions(+), 1 deletions(-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### First, update master and tag the release. | |
git checkout master #Switched to branch 'master' | |
git merge --no-ff hotfix-1.2.1 #Merge made by recursive... (Summary of changes) | |
git tag -a 1.2.1 | |
### Next, include the bugfix in develop, too: | |
git checkout develop #Switched to branch 'develop' | |
git merge --no-ff hotfix-1.2.1 #Merge made by recursive... (Summary of changes) | |
### Finally, remove the temporary branch: | |
git branch -d hotfix-1.2.1 #Deleted branch hotfix-1.2.1 (was abbe5d6). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://nvie.com/posts/a-successful-git-branching-model/