Learn

Git tutorials

Short, hands-on lessons, in order. Every command is copy-pasteable.

  1. Install and configure Git
    beginner · 8 min

    Install Git on macOS, Windows or Linux and set the handful of settings every developer should have.

  2. Your first repository
    beginner · 10 min

    Create a repository, stage changes, commit, and read the history. The core Git loop in ten minutes.

  3. Branching and merging
    beginner · 12 min

    Create branches, switch between them, and merge them back. This is the building block of every Git workflow.

  4. The Gitflow workflow, step by step
    intermediate · 18 min

    Run a full Gitflow cycle (feature, release and hotfix) with plain Git commands and with the git-flow extension.

  5. Rebase vs merge
    intermediate · 12 min

    Two ways to combine work. What each does to history, when to use which, and the one rule you must never break.

  6. Undoing things in Git
    intermediate · 14 min

    restore, reset, revert and reflog. Pick the right undo for the situation and recover "lost" work.

  7. Remotes and pull requests
    beginner · 12 min

    Clone, fetch, pull and push, then open a pull request. How Git workflows play out on GitHub and GitLab.