Skip to main content

SourceTree UI ↔ Git Command

Cheat sheet: which button you press and what command runs underneath.

SourceTree button/actionActual Git command
Pullgit pull
Pushgit push origin <branch>
Fetchgit fetch
Commitgit commit -m "..." (after git add)
Checkbox to stagegit add <file>
Branch (new)git checkout -b <name>
Double-click a branchgit checkout <branch>
Mergegit merge <branch>
Rebasegit rebase <branch>
Stashgit stash
Stash Popgit stash pop
Taggit tag <name>
Right-click commit → Resetgit reset --soft/mixed/hard <commit>
Right-click commit → Revertgit revert <commit>
Discard on a filegit checkout -- <file>
danger

Discard deletes your local changes and cannot be undone.