How do I pull a single file from repository and not the whole repository using SourceTree?

I have a fairly large repository that I am working with and I would like to pull just a single file from the repository and not the full repository itself. I did not know if this was possible using SourceTree.

2 answers

Not that I know of. GUIs like SourceTree that wrap command line utilities aren't typically designed to enable you to do everything you might ever want to do. Just pop open the terminal and run a command for something like that.

You're right - SourceTree does NOT support this,

You can not do this with Sourcetree but with git commandline, using the command git archive.

To be able to use git archive your repository server needs to support this as well, Using Bitbucket Server as repository host, you need to have installed the plugin on your Bitbucket server.

Having installed this plugin on your Bitbucket server, you are able to retrieve a single file:

git archive –remote ssh:// HEAD

The main restriction is you have to use the SSH-Protocol with this (no HTTP-Protocol support)

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,224 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