Skip to content

05. Git Cheatsheet

Lucy Stringer edited this page Feb 23, 2021 · 1 revision

GIT BRANCH CHEATSHEET

This is your handy guide to working from the repo as a group!

Repo owner

  1. Go to the repo settings
  2. On the left click on branches
  3. In protected branches to select you want to protect (main)
  4. In pull requests subheading : Require pull request reviews before merging

Team set up

  1. Create a development branch - helps protect the main branch
  2. Be consistent with branch naming with prefixes - will agree tomorrow am
  3. Commit code often - like after every single stage of the TDD cycle (i.e. test, code working, refactor)

Branches

  1. git checkout -b <insert branch name here> this creates and moves to new branch
  2. Draw the owl
  3. Once happy with commit (see step 3) and have pushed.
  4. Go to Repo owner's repo. Click pull request, select your branch and compare to development branch
  5. Send pull request to the group chat.
  6. Other team review and discuss. Once happy we can merge!
  7. Once both branches have merged to development branch, use git pull to get all info
Clone this wiki locally