Git Fundamentals: Commits, Branches and Collaboration

Learn Git from commits and branches to merging, rebasing, remotes and undoing mistakes. For developers new to version control.

Start course →

What you'll learn

  • Initialize, clone and commit changes using the staging area.
  • Create, switch, merge and rebase branches and resolve conflicts.
  • Sync with remotes using push, pull and fetch.
  • Undo mistakes with restore, reset, revert and reflog.
  • Use stash, tags, blame, cherry-pick and bisect, and follow a team workflow.

Syllabus

Module 1: Getting Started

  1. What is Version Control?
  2. Installing Git
  3. Configuring Your Identity

Module 2: Starting a Repo

  1. git init
  2. git clone
  3. The .git Directory

Module 3: The Basic Workflow

  1. The Three States
  2. add, commit & status
  3. diff & log

Module 4: Branching

  1. What is a Branch?
  2. Creating & Switching Branches

Module 5: Merging

  1. git merge
  2. Resolving Merge Conflicts

Module 6: Rebasing

  1. What Rebase Does
  2. Interactive Rebase

Module 7: Remotes

  1. git remote
  2. push, pull, fetch & Tracking

Module 8: Undoing Things

  1. Discarding File Changes
  2. git reset: soft, mixed, hard
  3. git revert
  4. Recovering Work with reflog

Module 9: Ignoring & Stashing

  1. .gitignore
  2. git stash

Module 10: History & Inspection

  1. Formatting git log
  2. blame, show & Tags
  3. cherry-pick & bisect

Module 11: Workflows

  1. Feature Branch Workflow
  2. Git Flow vs Trunk-Based