Git Tutorial
Master version control with Git. Learn essential workflows for collaborative development and manage your code with confidence.
Learn Git from scratch — staging, commits, branching, merging, remotes, rebase, cherry-pick, reflog, bisect, GitHub pull requests, Actions, submodules and…
Part of the free Git course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.
New to Git? Every developer needs this.
Start with Lesson 1 — Introduction to Version Control. Git is essential for any coding career, and this course makes it easy.
Lessons in this course
- Introduction to Version Control — Why version control exists and how Git tracks changes in your project
- Git Basics: Clone, Add, Commit — The three core Git commands every developer uses every single day
- Branching and Merging — Create isolated branches to work on features, then merge them back safely
- Working with Remote Repositories — Push and pull code to GitHub, GitLab, or Bitbucket with git push/pull
- Resolving Merge Conflicts — Understand why conflicts happen and how to resolve them confidently
- Git Workflows and Best Practices — Feature branch workflow, GitFlow, and commit message conventions
- The Staging Area & git diff — Stage changes precisely with git add -p and inspect them with git diff
- Undoing Changes: restore, reset & revert — Safely undo mistakes — restore files, reset commits, or revert in public history
- Stashing Work in Progress — Shelve unfinished changes with git stash and bring them back later
- Ignoring Files with .gitignore — Keep build artifacts and secrets out of Git with patterns and globs
- Exploring History with git log — Read project history with log, --oneline --graph, filtering, and git show
- Amending & Fixing Commits — Fix the last commit's message or contents with git commit --amend
- Tagging Releases — Mark versions with lightweight and annotated tags, and semantic versioning
- Rebasing Branches — Replay commits for a linear history — and the golden rule of rebasing
- Interactive Rebase: squash, edit, reorder — Clean up history with git rebase -i — squash, fixup, reword, and edit
- Cherry-Picking Commits — Apply a specific commit from one branch onto another with git cherry-pick
- Recovering Lost Work with reflog — Rescue lost commits and branches after a bad reset using git reflog
- Finding Who Changed What with git blame — Trace each line to its commit with git blame and the pickaxe (log -S)
- Hunting Bugs with git bisect — Binary-search your history to find the commit that introduced a bug
- Git Configuration & Aliases — Set up your identity, editor, and time-saving aliases with git config
- GitHub Pull Requests & Code Review — Open, review, and merge pull requests — the heart of team collaboration
- Forking & Contributing to Open Source — Fork a project, keep it in sync with upstream, and contribute via PRs
- Intro to GitHub Actions (CI/CD) — Automate tests and deploys on every push with GitHub Actions workflows
- Submodules & Monorepos — Embed one repo inside another with submodules — and when to avoid them
- Git Hooks & Automation — Run checks automatically with pre-commit and commit-msg hooks (and husky)
- Multiple Working Trees with git worktree — Check out several branches at once in separate directories that share one .git
- Git LFS & Large Files — Track binaries and large assets with pointer files and an LFS server
- How Git Works Internally — Blobs, trees, commits and the DAG — what a SHA really points to