Git Tutorials & Guides

Practical guides with interactive examples. Learn Git from the basics to advanced workflows.

BasicsBeginner

git init: Creating Your First Repository

Learn how to create a Git repository from scratch. Understand what git init does, what's inside the .git folder, and how to make your first commit.

git initgit addgit commit
6 min
BasicsBeginner

git commit: Saving Your Work Step by Step

Master the git commit workflow. Learn how to stage files, write great commit messages, amend commits, and use visual staging tools.

git addgit commitgit commit --amend
8 min
BranchingBeginner

Git Branches Explained: Create, Switch, and Manage

Understand Git branches from the ground up. Learn to create, switch, list, and delete branches with clear examples and visual explanations.

git branchgit switchgit checkout -b
7 min
BranchingIntermediate

git merge vs git rebase: When to Use Each

Understand the difference between merge and rebase, when to use each strategy, and how to handle conflicts. Includes visual commit graph examples.

git mergegit rebasegit rebase -i
10 min
WorkflowBeginner

git stash: Save Work Without Committing

Learn how to use git stash to temporarily save changes. Covers stash, pop, apply, list, and managing multiple stashes with practical examples.

git stashgit stash popgit stash apply
6 min
BasicsBeginner

git status & git diff: Understanding What Changed

Learn how to inspect your repository with git status and git diff. Understand the three file states, read diff output, and review changes before committing.

git statusgit diffgit diff --staged
8 min
BasicsBeginner

git pull & git push: Syncing Your Code with the Team

Learn how to sync your local repository with a remote server. Understand git fetch, git pull, and git push, and handle common issues like rejected pushes and merge conflicts.

git fetchgit pullgit push
9 min
BranchingBeginner

Resolving Merge Conflicts: A Step-by-Step Guide

Learn how to read and resolve Git merge conflicts with confidence. Understand conflict markers, resolve step by step, and use visual tools to make the process painless.

git mergegit merge --abortgit add
10 min
WorkflowBeginner

Your First Pull Request: A Complete Workflow

Walk through the complete pull request workflow from branch to merge. Learn branch naming conventions, how to write a good PR, and manage the review process.

git switch -cgit push -ugit rebase
10 min
WorkflowBeginner

.gitignore: Keeping Secrets and Junk Out of Your Repo

Learn how to use .gitignore to exclude dependencies, build output, secrets, and OS files from your repository. Includes pattern syntax, templates by language, and how to untrack already committed files.

git rm --cachedgit check-ignoregit add
8 min
WorkflowBeginner

Writing Better Commit Messages: A Practical Guide

Learn how to write clear, useful commit messages. Covers the subject-body-footer structure, Conventional Commits, and AI tools that help you write better messages.

git commitgit commit -mgit log --oneline
9 min
BasicsBeginner

git reset & git restore: Undoing Mistakes Safely

Learn how to undo changes at every stage of the Git workflow. Covers git restore for file-level undo, git reset --soft/--mixed/--hard for commit-level undo, and git revert for shared branches.

git restoregit reset --softgit reset --hard
10 min
WorkflowBeginner

Line-Level Staging: Committing Only What You Need

Master partial staging with git add -p and visual tools. Learn to stage individual hunks and lines for clean, focused commits from messy coding sessions.

git add -pgit diff --stagedgit stash --keep-index
9 min
BasicsBeginner

Reading git log Like a Pro

Master git log with practical examples. Learn useful flags like --oneline, --graph, and --author, plus how to search and filter your commit history.

git loggit log --onelinegit log --graph
7 min