Skip to content

Instantly share code, notes, and snippets.

@the-Jamz
Created November 24, 2022 18:27
Show Gist options
  • Save the-Jamz/cb4564cd84ab53f4621c2ad7e9e3de27 to your computer and use it in GitHub Desktop.
Save the-Jamz/cb4564cd84ab53f4621c2ad7e9e3de27 to your computer and use it in GitHub Desktop.
Git Tutorial

The Git Guide

Basics

Git is a version control system. It helps us keep track of changes, work in parallel, and review code. Git is an industry standard tool that almost everyone in the software engineering world uses. Github helps us manage our git repositories.

Principals

  • Do NOT commit large changes directly to master/main
  • Make PRs, code review is good
  • Keep PRs small, so they're easier to review
  • Rebase before merging PRs

These ideas are based around making a clean history, and having good code review. eg:

------------------------- main

\___/\___/\___/\___/\___/ branches with changes

Guides

Cheat Sheet

Commands you may forget but are extremely useful.

  • git checkout -b new-branch > creates and checks out the branch "new-branch"
  • git checkout new-branch > check existing branch "new-branch"
  • git rebase main > rebase your current branch onto main
  • git pull > fetch new updates from the git server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment