Skip to content
Brandon Bouchard edited this page Nov 22, 2022 · 4 revisions

GitHub Flow

GitHub Flow Documentation

Diagram

%%{init: { 'logLevel': 'debug', 'theme': 'base' } }%%
    gitGraph
        commit
        commit
        branch feature_branch
        checkout feature_branch
        commit
        checkout main
        commit
        commit
        checkout feature_branch
        commit
        commit
        checkout main
        merge feature_branch
        commit
Loading

TL;DR

Create and Checkout a new branch

First do a git pull on you local main branch to ensure that it is up-to-date with origin/main.

When starting a new bucket of work, create and checkout a feature branch, using git checkout -b {branch_name} with the following naming convention:

utopia-{jira-ticket-#}

Note: Scope commits into meaningful and granular changes.


Create Pull Request

Make a GitHub Pull Request and be ready to receive and address comments from your peers.


Merge

Once the Pull Request has been approved, it is time to merge your feature branch into the main branch.


List of useful Git commands

  • git rebase
  • git rebase -it HEAD~{# of commits back} <-- use this to start an interactive rebase (a.k.a. squash)
  • git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit <-- This creates a log that is much easier to parse than the standard output