Git Cheat Sheet
Quick reference for terminal and Git commands. Git commands are the same in every shell — only the navigation commands differ.
Navigation Commands
| What it does |
Git Bash |
PowerShell |
| Show current folder path | pwd | pwd or Get-Location |
| List files in current folder | ls | dir or ls |
| Go into a folder | cd FolderName | cd FolderName |
| Go up one level | cd .. | cd .. |
| Create a new folder | mkdir my-folder | mkdir my-folder |
| Clear the screen | clear | cls |
| Open current folder in Explorer | explorer . | explorer . |
| Open current folder in VS Code | code . | code . |
Git Quick Reference
| What it does |
Command (same in both shells) |
| See what has changed | git status |
| See line-by-line changes | git diff |
| Stage a file | git add filename.txt |
| Stage everything | git add . |
| Commit staged changes | git commit -m "message" |
| Push to the remote | git push |
| Pull from the remote | git pull |
| Create and switch to new branch | git switch -c feature/name |
| Switch to existing branch | git switch branch-name |
| See commit history | git log --oneline |
| Save work-in-progress | git stash |
| Restore stashed work | git stash pop |