How to checkout a forked pull request locally in SourceTree?

1 answer

0 votes

Is there a reason you cannot just check out the branch that the PR is related to?

I would generally suggest switching to the PR branch, and testing the code there.


The PR should be a representation of the changes existing on a branch that are being requested to be merged into another branch (usually master), so checking out the source branch should achieve what you are after.

The pull request was from another user's forked clone of the project repo.  I didn't see any option that would allow me to checkout that branch with SourceTree's checkout dialog.  The pull request branch was not visible.

You would need to check out a copy of the forked repo's branch in order to do that. Sourcetree is just a view over the top of your local git repositories - so the first step is to get that forked repo.

You can do that by clicking on the source branch within the PR in Bitbucket (clicking the repo name on the left in the screenshot below will do that for you).

Screen Shot 2016-08-07 at 10.41.02 AM.png


Then once you are in that branch, there should be a checkout branch option on the left, with a checkout in sourcetree option.

Screen Shot 2016-08-07 at 10.44.02 AM.png


This will then let you pull down the contents of the PR for local testing, review and validation. From what I know there is not a way to do this action within sourcetree directly, as sourcetree is used to work with the git repos that you have locally and not to work with PRs or remote repos that you may have access to in Bitbucket or Github.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,229 views 4 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you