π§βπ» GitHub Desktop vs Git CLI Cheat Sheet
A quick-reference guide to help you understand what GitHub Desktop is doing behind the scenes β and how to do the same with raw Git commands.
Action in GitHub Desktop
Equivalent Git Command
Fetch
git fetch origin
Pull
git pull origin <branch>
Push
git push origin <branch>
Action in GitHub Desktop
Equivalent Git Command
Create new branch
git checkout -b <new-branch>
Switch branch
git checkout <branch>
Rename branch
git branch -m <new-name>
Delete local branch
git branch -d <branch>
Delete remote branch
git push origin --delete <branch>
Action in GitHub Desktop
Equivalent Git Command
Merge main
into current branch
git merge origin/main
Rebase current onto main
git rebase origin/main
Resolve conflicts
Edit files + git add <file>
Finish merge
git commit
(if needed)
Action in GitHub Desktop
Equivalent Git Command
Stage changes
git add <file>
Unstage changes
git reset <file>
Commit
git commit -m "message"
Amend last commit
git commit --amend
Action in GitHub Desktop
Equivalent Git Command
View commit history
git log --oneline --graph --decorate
View changes in a commit
git show <commit>
Revert commit
git revert <commit>
Checkout old commit
git checkout <commit>
(detached HEAD)
π΅οΈ Inspect GitHub Desktop Internals
Task
Tip
See raw commands used
Open DevTools: Cmd+Opt+I
(Mac) / Ctrl+Shift+I
(Win/Linux)
Show actual Git repo
Right-click repo β "Show in Finder"/"Reveal in Explorer"
Sync CLI + Desktop
Just use the same .git
repo folder from terminal
GitHub Desktop always uses the local .git
repo β anything you do in CLI will reflect there immediately.
You can combine Desktop's UI with CLI power tools (git log
, tig
, lazygit
, etc.)
To debug more: try git reflog
or git status
in terminal after Desktop actions.
Keep this cheat sheet nearby while learning Git β and become unstoppable in both UI and terminal workflows!