Created
July 14, 2021 12:38
-
-
Save NathanaelZuchuon/7958e7333ac817967c385e85c4cb2170 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//============= Assuming that we have our project with git initialized, create the Develop branch: | |
git branch develop | |
git push -u origin develop (if you are creating it) | |
git checkout -b develop origin/develop (if you are cloning and copying locally the develop branch) | |
// Create the a feature: | |
git checkout -b new-awesome-feature | |
git add <perfect-code-made-by-us> | |
git commit | |
//============= The new feature is completed and commited with the last command, so we need to merge it into Develop branch | |
//but first, let be sure that nothing has changed on this branch: | |
git pull origin develop (checking for up to date) | |
git checkout develop (switching to local develop branch) | |
git merge new-awesome-feature | |
git push | |
git branch -d new-awesome-feature (deleting the new feature branch) | |
//============= Prepare a new Release branch that will be used for testing, documentation | |
git checkout -b release-0.1 develop (creating the release branch) | |
//============== Ship it to production (Master) and Develop as well: | |
git checkout master (switching to local master branch) | |
git merge release-0.1 (merging) | |
git push | |
git checkout develop (switching to local develop branch) | |
git merge release-0.1 (merging as well) | |
git push | |
git branch -d release-0.1 (deleting the release branch) | |
//============== And don’t forget the tag :) | |
git tag -a 0.1 -m “new-feature completed and released” master | |
git push — tags | |
//=============== Create Hotfixes | |
git checkout -b issue-001 master (creating the hotfix branch) | |
git checkout master (bug/issue fixed and committed at this step) | |
git merge issue-001 | |
git push | |
//=============== Merge Hotfixes into develop | |
git checkout develop | |
git merge issue-001 | |
git push | |
git branch -d issue-001 (deleting the hotfix branch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment