Last active
May 17, 2021 00:29
-
-
Save derek-duncan/f1bf8f7233bafb493874 to your computer and use it in GitHub Desktop.
Git workflow for small teams
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
# [pivital-story-id]-[feature-name] | |
# All lowercase. Spaces replaced with dashes | |
94198518-cs-block-bugs |
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
# Pull newest updates from stage | |
git checkout stage | |
git pull origin stage | |
# Create your feature branch | |
git checkout -b 1234-my-new-feature | |
# ..work and commit some stuff | |
# Ready to push? Okay. First, fix all conflicts between dev and 1234-my-new-feature on your local so we can simply fast-forward when we push. | |
git fetch origin | |
git rebase origin/dev | |
# QA on local machine. If updates, repeat previous step | |
# Merge your feature into dev. Also, let's squash it into one commit | |
git checkout dev | |
git merge --squash 1234-my-new-feature | |
git commit -m "added My New Feature" | |
# Push | |
git push | |
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
# ..you need to push updates after QA | |
# Checkout your branch to make updates | |
git checkout 1234-my-new-feature | |
# ..update and commit stuff | |
git fetch origin | |
git rebase origin/dev | |
# QA on local machine. If updates, repeat previous step | |
# Merge the updated branch into dev | |
git checkout dev | |
git merge --squash 1234-my-new-feature | |
git commit -m "updated My New Feature" | |
# Push | |
git push |
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
# Fix all conflicts between dev and stage before we merge | |
git checkout dev | |
git merge stage | |
git checkout stage | |
git merge -m 'Release 15.05.13.1106 - Feature description' dev | |
git push | |
# We don't want to squash the dev commits on stage so we can exclude any blockers when it comes time to push to master |
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
# [Optional] Delete local branch if you're done developing | |
git branch -D 1234-my-new-feature |
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
http://stackoverflow.com/questions/457927/git-workflow-and-rebase-vs-merge-questions | |
http://stackoverflow.com/questions/1241720/git-cherry-pick-vs-merge-workflow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment