Sourcetree

Enjoy this cheat sheet at its fullest within Dash, the macOS documentation browser.

Repository Management

CMD+0

Show repository browser

Opens the Repository Browser window.

CMD+SHIFT+H

Show remote hosted repositories

Show the Repository Browser and select the Remote section.

Bookmark open repositories...

Prompts to add selected repositories to the Repository Browser.

UI Customization

CMD+SHIFT+K

Show/Hide sidebar

Toggle the current repository's sidebar (branches, tags, and more.)

CMD+CTRL+W

Show/Hide command history

Toggle the current repository's command history to view details.

CMD+1

File status view

Switch to the file browser and commit preparation area.

CMD+2

History view

Switch to the primary commit history browser area.

CMD+3

Search view

Switch to the commit history search area.

Show/Hide branch labels

Toggle the visibility of branch labels in commit history graphs for all repositories.

Show/Hide tag labels

Toggle the visibility of tag labels in commit history graphs for all repositories.

Show/Hide build status

Toggle the visibility of the Build Status column in the History view for the current repository.

Git Actions

CMD+SHIFT+F

Fetch...

Retrieve the current repository's branches, tags, and history from the remote server.

Interactive rebase...

Start interactively updating a branch's content to align with another.

CMD+SHIFT+-

Unstage from index

Remove the selected item(s) from the staging area prior to committing.

Mercurial Actions

CMD+SHIFT+U

Update

Retrieve the current repository's state from the remote server.

Archive

Save an archival copy of the repository.

Repository Actions

Migrate to Bitbucket Cloud...

Configure and migrate the current repository to Bitbucket Cloud.

CMD+SHIFT+,

Repository settings...

Configure settings for the current repository.

CMD+R

Refresh

Reload the current repository's commit history graph, file status, and build status.

CTRL+OPTION+R

Refresh remote status

Reload the current repository's status from the remote server.

CMD+SHIFT+C

Commit...

Go to current repository's File Status view, focus the message editor, and populate with a message template if available.

CMD+SHIFT+R

Revert... or Reset...

Begin reverting one or more of the current repository's in-progress changes.

CMD+SHIFT+S

Stash or Shelve

Save the current repository's in-progress changes for later use.

CMD+SHIFT+P

Push...

Send local commits for the current repository to the remote server.

CMD+SHIFT+L

Pull...

Retrieve any new commits for the current repository from the remote server.

CMD+OPTION+U

Update to... or Checkout...

Switch to a particular branch or revision in the current repository.

CMD+SHIFT+B

Branch...

Create a new branch from the currently active branch.

CMD+SHIFT+M

Merge...

Start the process of combining the target branch into the active one in the current repository.

CMD+SHIFT+T

Tag...

Create a new tag for the active branch and commit in the current repository.

Add remote...

Connect a new remote server to the current repository.

Add subrepository...

Connect another repository as a dependency for the current repository.

CMD+SHIFT+W

View remote

Open the remote server's website (if available) for the current repository.

CMD+OPTION+P

Create pull request...

Start a pull request on the remote server for the current active branch.

Item Actions

CMD+SHIFT+O

Open

Open the selected item(s) for the current repository.

Show in Finder

Open a new Finder window with the selected item(s) for current repository highlighted.

CMD+CTRL+T

Open in Terminal

Open a new Terminal window to the directory for the current repository.

Space

Quick Look

Display a preview of the selected item(s)'s contents if possible.

External diff

Open the assigned application (see Preferences) to display the item's changes.

Create patch...

Save the current repository's in-progress changes as a file for transfer or later use.

Apply patch...

Take the contents of a patch (file or text) and merge them into the current repository if possible.

CMD+SHIFT+=

Add

Add the selected untracked item(s) to the current repository's index, making them available for commit.

CMD+Delete

Remove

Remove the selected item(s) from the current repository's index and on-disk; requires a commit to save.

CMD+OPTION+SHIFT+=

Add / Remove

Combines the Add and Remove actions (see their entries) into a single task for all the selected item(s).

Stop tracking

Remove the selected item(s) from the current repository's index; requires a commit to complete.

Ignore...

Create entries (specific patterns, file types, or other designations) for items that should be ignored completely in the current repository.

Commit...

Ensure the selected item(s) are included in the current commit and focus the message editor, populating with a message template if available.

CMD+OPTION+R

Reset... or Revert...

Begin reverting in-progress changes for the selected item(s).

Reset to commit... or Revert to reversion...

Begin reverting the selected item(s) to a specific point in their history.

Continue

Proceed to the next step of an in-progress action such as rebasing or grafting.

Abort

Stop an in-progress action such as rebasing or grafting.

CMD+OPTION+L

Log selected...

Show a list of commits specific to the selected item in reverse chronological order.

CMD+OPTION+B

Annotate selected...

Display the contents of the selected item, as lines, with the latest commit's information (author, date, metadata) alongside.

Copy...

Create a copy of the selected item(s) in the current repository using appropriate source control mechanisms.

Move...

Move the selected item(s) from one location to another (including renaming) in the current repository using appropriate source control mechanisms.

Resolving Conflicts

Launch external merge tool

Open the diff for the conflicted item(s) in the application specified in Preferences -> Diff.

Resolve using 'mine'

Choose the contents of the current branch when there's a conflict.

Resolve using 'theirs'

Choose the contents of the branch that you are merging when there's a conflict.

Restart merge

Cancel an in-progress merge.

Mark resolved

Update the selected item(s) to indicate conflicts were resolved manually.

Mark unresolved

Update the selected item(s) to indicate a conflict or other problem exists still.

Git LFS

Initialize repository

Configure the necessary changes to enable Git LFS for the current repository.

Track/Untrack files...

Add or remove the selected item(s) from the Git LFS index and storage when pushing.

Pull LFS content

Fetch any LFS changes from the remote for the current repository and then checkout appropriate files.

Fetch LFS content

Retrieve LFS changes from the remote for the current repository.

Checkout LFS content

Retrieve large file content from the Git LFS storage endpoint to replace existing placeholder files in the current repository.

Prune LFS content

Remove LFS item(s) that have been checked out into the current repository. This frees up space if they are unused.

Git/Hg Flow

Initialize repository

Configure Flow prefixes for the current repository.

CMD+OPTION+F

Next action...

Begin the next Flow action based on what's currently in progress for the current repository.

Start new feature

Create a branch with the feature prefix and specified name.

Finish feature

Wrap up the in-progress Flow feature branch.

Start new release

Create a branch with the release prefix and specified name.

Finish release

Wrap up the in-progress Flow release branch.

Start new hotfix

Create a branch with the hotfix prefix and specified name.

Finish hotfix

Wrap up the in-progress Flow hotfix branch.

Text Formatting

CMD+OPTION+-

Header

Wraps the selected text in Markdown syntax for a header.

CMD+OPTION+SHIFT+-

Horizontal rule

Inserts the Markdown syntax for a single line.

CMD+B

Bold

Wraps the selected text in Markdown syntax to be bold.

CMD+I

Italic

Wraps the selected text in Markdown syntax to be italicized.

CMD+L

Bulleted list

Inserts the Markdown syntax for a bullet at the start of selected text.

CMD+OPTION+O

Numbered list

Inserts the Markdown syntax for a number sequence at the start of selected text.

CMD+'

Code block

Wraps the selected text in Markdown syntax to be formatted as code.

CMD+OPTION+K

Link

Wraps the selected text in Markdown syntax for a link, focused to edit the URL portion.

Notes