arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

GitHub Workflow

A good GitHub workflow is essential to keeping a project organised and easy to maintain. The larger the project, the more important it becomes to track changes and be aware of who worked on what.

Some things to keep in mind:

  • Make sure everyone has the same code formatter (prettierarrow-up-right) set up, so you can avoid merge conflicts due to weird spaces/extra commas etc.

  • Never work on the main branch. Before you start work, make sure you pull main and create a new branch.

  • Commit often. This makes it easier to undo specific changes.

  • Write meaningful commit messages. A good convention to follow for commit messages is that they should be imperative, i.e: "add tests for signup form"

  • Your commit messages should make sense if read in this format: "If applied, this commit will: <your commit message>"

  • If you've been coding for half a day and forgot to commit, VSCode lets you from the source control panel.

  • , and close issues as you finish working on them.

  • Review PRs as a team, and merge together. In smaller weekly projects where there isn't time for code review on every PR, make sure the other pair has seen your work and any implications it has on their code.

When you pair, don't forget to co-commit! (you can find more information in the )

  • When you finish working on your branch, make sure it's up-to-date with main before pushing

  • stage selected linesarrow-up-right
    Link PRs to issuesarrow-up-right
       git checkout main
       git pull
       git checkout -b "fix-login-button"
       git add .
       git commit -m "fix bug with login button"
       git pull origin main
       git push origin <type-current-branch-name-here>
    GitHub Docsarrow-up-right