Is it possible to pull from a remote repository but only selectively take files from that remote that I’m interested in? I don’t want to simply pull down the entire branch.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A “remote branch” is nothing more than a commit pointer and the affiliated pack data. Just
git fetch <remote>and then if you want to view diffs between files on the remote and your local, you can do so with:This would in many cases be, for example,
git diff master origin/master -- <file>. You could also see the commit differences withgit log:so…
git log master..origin/master -- <file>Finally if you just want to checkout a particular version of a file from the remote (this wouldn’t be ideal; much better to merge the remote branch with
git merge <remote>/<remote_branch>orgit pull), use: