Cheatsheet SourceTree
Cliente Git gráfico gratuito para Windows e Mac
SourceTree
20
cards found
Categories:
Versions:
Archive and Repo
Open / Clone
Ctrl + O (open repo)
Ctrl + Shift + O (clone)
File → New → Clone from URL
File → New → Create Local
Open repositories.
Views
File Status # changed files
History # commit log
Branches # branch list
Remotes # remote repositories
Stashes # saved changes
Main panels.
Configuration
Tools → Options → Git
Configure name and email
Choose Git version
SSH keys: Tools → Create SSH Key
Configure SourceTree.
Commits
Make a Commit
Ctrl + Enter (commit)
File Status → select files
Write message
Commit / Commit & Push
Create a commit.
Stage / Unstage
Stage Selected → move to staged
Unstage Selected → back to unstaged
Stage All / Unstage All
Discard → revert changes
Manage the staging area.
Amend and History
Right-click the last commit
→ Amend Last Commit
→ Reset current branch to this commit
History → view diff of each commit
Modify commits.
Diff and Blame
Click the file → view diff
Right-click → Annotate (blame)
Click a line → view commit
Diff against branch: right-click → Diff
Compare changes.
Branches
Create Branch
Ctrl + B (new branch)
Branch → New Branch
Name: feature/new-feature
Checkout New Branch (switch now)
Create a new branch.
Manage Branches
Right-click the branch:
→ Checkout
→ Delete
→ Rename
→ Push to origin
→ Track remote branch
Branch operations.
Compare Branches
Select 2 branches
→ Diff Against Current
See commits ahead/behind
Log filtered by branch
Compare branches.
Remote
Push
Ctrl + Shift + P (push)
Push → select branch
Push tags: include checkbox
Force push: Options → Force
Send to remote.
Pull and Fetch
Ctrl + T (pull)
Ctrl + Shift + T (fetch)
Pull → Rebase instead of merge
Prune: remove stale refs
Get remote changes.
Remotes
Repository → Repository Settings
→ Remotes tab
Add / Edit / Remove remote
URL: https or SSH
Manage remotes.
Merge and Rebase
Merge
Checkout target branch
Right-click the source branch
→ Merge
→ Squash commits (optional)
Resolve conflicts in the editor
Integrate branches.
Rebase
Right-click the base branch
→ Rebase current branch onto
Interactive: resolve step by step
Abort: Actions → Resolve Conflicts → Abort
Rebase a branch.
Resolve Conflicts
Conflicted files → highlighted
Click → Resolve Conflicts
→ Open in Merge Tool
Accept: Use Mine / Use Theirs
Mark Resolved → Commit
Resolve merge conflicts.
Advanced
Stash
Ctrl + Shift + S (stash)
Repository → Stash
Apply Stash / Pop Stash
Drop Stash (delete)
Save temporary changes.
Cherry-pick
History → select commit
Right-click → Cherry Pick
Applies only that commit
Useful for backports
Apply a specific commit.
Tags
Repository → Create Tag
Name: v1.0.0
Annotated: with message
Push tag: Push → include tags
Create and manage tags.
Reset and Revert
Right-click the commit:
→ Reset to this commit
Soft / Mixed / Hard
→ Revert commit
(creates inverse commit)
Undo changes.