SourceTree UI ↔ Git Command
Cheat sheet: which button you press and what command runs underneath.
| SourceTree button/action | Actual Git command |
|---|---|
| Pull | git pull |
| Push | git push origin <branch> |
| Fetch | git fetch |
| Commit | git commit -m "..." (after git add) |
| Checkbox to stage | git add <file> |
| Branch (new) | git checkout -b <name> |
| Double-click a branch | git checkout <branch> |
| Merge | git merge <branch> |
| Rebase | git rebase <branch> |
| Stash | git stash |
| Stash Pop | git stash pop |
| Tag | git tag <name> |
| Right-click commit → Reset | git reset --soft/mixed/hard <commit> |
| Right-click commit → Revert | git revert <commit> |
| Discard on a file | git checkout -- <file> |
danger
Discard deletes your local changes and cannot be undone.