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

David Berry May 10, 2016

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

1 vote
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 10, 2016

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.

Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 10, 2016

You're right - SourceTree does NOT support this,

0 votes
Johannes Kilian
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 10, 2016

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 https://marketplace.atlassian.com/plugins/com.atlassian.stash.plugin.stash-archive/server/overview on your Bitbucket server.

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

git archive –remote ssh://git@bitbucket.vitronic.de:7999/bma/uploadadditional.git HEAD README.md

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
TAGS
AUG Leaders

Atlassian Community Events