Git26 commands
Git Cheat Sheet
Essential Git commands for version control — branching, merging, rebasing, stashing, and collaboration.
Setup & Config
| Command | Description |
|---|---|
| Initialize a new repo |
| Clone a repository |
| Set username |
| Set email |
Basic Workflow
| Command | Description |
|---|---|
| Show working tree status |
| Stage all changes |
| Stage specific file |
| Commit staged changes |
| Push to remote |
| Fetch and merge from remote |
| Show unstaged changes |
| Show staged changes |
Branching
| Command | Description |
|---|---|
| List branches |
| Create branch |
| Switch branch |
| Create and switch |
| Merge branch into current |
| Rebase onto branch |
| Delete merged branch |
Stash & Undo
| Command | Description |
|---|---|
| Stash changes |
| Apply and remove stash |
| List stashes |
| Undo last commit, keep changes |
| Undo last commit, discard changes |
| Create undo commit |
| Show last 10 commits |