Git
Git cheat sheet with commands for branching, merging, rebasing, stashing, cherry-picking, and advanced version control techniques.
Getting Started
Initial Setup
Configure Git for first time use with your identity
Create & Clone Repositories
Start a new project or get an existing one
.gitignore
Tell Git which files and directories to ignore
Making Changes
Check Status & Differences
See what has changed in your working directory
Stage & Commit Changes
Save your work to the repository history
Branching
Branch Management
Create, list, and delete branches for parallel development
Merging
Combine changes from one branch into another
Rebasing
Replay commits on top of another base for a linear history
Cherry-pick
Apply specific commits from another branch onto the current one
Working with Remotes
Remote Repositories
Connect and sync with remote repositories
Stashing Changes
Save Work Temporarily
Store uncommitted changes for later without committing
Fixing Mistakes
Undo Changes
Revert uncommitted changes in your working directory
Revert Commits
Undo committed changes by creating new commits
Recover with Reflog
Find and recover commits that look "lost" after rewrites
Merge Conflicts
Resolve Conflicts
Handle and fix merge conflicts when combining branches
Viewing History
Log & History
Explore repository history and find specific commits
Tags & Releases
Version Tagging
Mark specific commits as releases or milestones
Advanced Techniques
Submodules
Include other Git repositories within your project
Bisect (Find Bugs)
Binary search through history to find the commit that introduced a bug
Worktrees
Work on multiple branches simultaneously in different directories
Quick Reference
Daily Workflow
Common Git workflow for everyday development
Useful Aliases
Set up shortcuts for common Git commands