Branching flowchart

  1. Each new feature should be as small as possible, so that a single person can undertake the challenge.

  2. 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.

  3. 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

  4. Make a new branch specifically for this feature, named after the task & Issue.
    ⌘⇧N

  5. 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

  6. 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

  7. 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.

  8. If there are any conflicts, because someone else edited the same code, resolve them using GitHub’s interface.

  9. 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

  10. 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.
  11. 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.

  12. 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

  13. Close the original task Issue and make sure the cards in the project board are in the “Done” column.

    • Use Fixes #80 or Closes #77 in commit message descriptions to automatically close Issues.
  14. The local feature branch, on your computer, is no longer needed so delete it from your computer too.

  15. Finally, make sure the code inside your repository is the most up-to-date version by pulling.
    ⌘⇧P