how can i do a partial pull in source tree

Sreekanth Thanuku May 25, 2016

My Colleague has pushed 5 files in one single commit and push through source tree, I want to pull only 3 of them, I did not find a way to do it so in source tree, can you help

4 answers

2 votes
thinsoldier
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 25, 2016

If using sourcetree with git I think you can only pull whole commits and not individual files. Even if your colleague had made a separate commit for each of the 5 files, to be up to date with his repository you'd have to get all 5 of those commits which would still mean having to download 5 files.

If 2 of the 5 files are really not important maybe they should be ignored with .gitignore file.

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 26, 2016

If the changes were in separate commits, you could "cherry pick" the commits that you wanted.

SourceTree does not provide a way to pull in part of a commit, and even Git doesn't do that in a way that tracks the history of the change accurately.

See this question regarding acheiving what you're trying to do via command line (SourceTree > Terminal): http://stackoverflow.com/a/4316039/1476926

0 votes
QwazyWabbit
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 25, 2016

I believe the correct procedure is to branch at your colleague's commit, select the files you want from your colleague and pull them, then merge your branch once you've completed your edits within the branch. In fact, Git will merge your branch with the master when you commit and push. 

0 votes
Yogesh Mude[Jira]
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 25, 2016

Hi,

You can achieve this using PULL tab which is present in source tree, once you click on that tab you will show one popup window and their you should select the where you want to pull the request ie Origin and select the remote branch. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events