GitLearnHub
Practice Flow
15px

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 pathpwdpwd or Get-Location
List files in current folderlsdir or ls
Go into a foldercd FolderNamecd FolderName
Go up one levelcd ..cd ..
Create a new foldermkdir my-foldermkdir my-folder
Clear the screenclearcls
Open current folder in Explorerexplorer .explorer .
Open current folder in VS Codecode .code .

Git Quick Reference

What it does Command (same in both shells)
See what has changedgit status
See line-by-line changesgit diff
Stage a filegit add filename.txt
Stage everythinggit add .
Commit staged changesgit commit -m "message"
Push to the remotegit push
Pull from the remotegit pull
Create and switch to new branchgit switch -c feature/name
Switch to existing branchgit switch branch-name
See commit historygit log --oneline
Save work-in-progressgit stash
Restore stashed workgit stash pop