Last active
December 8, 2016 23:20
-
-
Save rymawby/5874682 to your computer and use it in GitHub Desktop.
Git workflow
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
| # Create a development branch | |
| # Typically, branch from the current sprint branch: | |
| git fetch | |
| git checkout SPRINT_XX | |
| git pull origin SPRINT_XX | |
| git checkout -b <BRANCH_NAME> | |
| # Make atomic commits | |
| git add . | |
| git commit -m "TICKET-180: Did something awesome." | |
| # Squash commits | |
| # When development is complete, squashing tidies up history and makes rebasing much easier. | |
| git rev-list --count HEAD ^SPRINT_XX | |
| git rebase -i HEAD~X | |
| # where X is the number of commits made on the development branch (you can get this by using the rev-list call on the line above) | |
| # Rebase against the Sprint branch | |
| git checkout SPRINT_XX | |
| git pull origin SPRINT_XX | |
| git checkout - | |
| git rebase SPRINT_XX | |
| # Manage any conflicts. Then, ensure that all tests still pass and that the application still works as expected. | |
| # Push the branch | |
| git push -f origin <BRANCH_NAME> | |
| # Create a pull request | |
| # Action any changes that come out of the code review, making sure to again squash and rebase once these have been done. | |
| # The pull request should not be merged by the developer who has raised it. Paste the link to the PR into a Skype chat if you need it actioned quickly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment