Getting a single file from a Git remote repository
Say you want to get the contents of a single file from a Git remote repository without having to clone it. Here's a hack you can use with recent versions of Git:
git archive --remote=git@gitserver.example.com:myrepo master path/to/file1 | tar -xOf - > file1
The above gets the file at the specified path from <tt>master</tt>.
Written by Ravi Sarma
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#