Branching flowchart
-
Each new feature should be as small as possible, so that a single person can undertake the challenge.
-
Make a detailed Issue including adding it to a Sprint, assigning it to a single person & giving it appropriate labels. See Agile project planning for more details.
-
Before branching, make sure you’re viewing the
master
branch, then you must pull the most recent code from the GitHub website so yours is up-to-date.⌘⇧P
-
Make a new branch specifically for this feature, named after the task & Issue.
⌘⇧N
-
Write code and commit regularly. Be sure to follow the Git commit best practices. It’s okay if the commits are incomplete because we’re coding on a separate branch it’s not going to affect the live website.
⌘ Return
-
You can publish the branch to the GitHub website whenever you’re ready. Without a pull request the published branch just kinda sits there.
⌘P
-
When you’re ready for someone else to look at the code—even if it isn’t complete—make a pull request. Use pull requests as a discussion board. Follow the Sprint best practices and use labels, projects, milestones & assignees.
-
If there are any conflicts, because someone else edited the same code, resolve them using GitHub’s interface.
-
Because of the conflict resolution, code changed, so we need to make sure that your local feature branch is the most up-to-date version of the code. So pull again.
⌘⇧P
-
A teammate should now look of the code and decide whether to approve or reject the code.
- If the code isn’t good enough make detailed comments, even comment on specific lines.
- If the code is good, write a nice, positive message.
-
If the pull request was rejected, you (as the original author), must fix the code and create new commits. You do not have to create a new branch, work on the same branch until this pull request is resolved.
-
When the code is approved, merge the pull request and delete the branch from GitHub’s website. The feature branch is no longer necessary because the code has been merged into
master
-
Close the original task Issue and make sure the cards in the project board are in the “Done” column.
- Use
Fixes #80
orCloses #77
in commit message descriptions to automatically close Issues.
- Use
-
The local feature branch, on your computer, is no longer needed so delete it from your computer too.
-
Finally, make sure the code inside your repository is the most up-to-date version by pulling.
⌘⇧P