Last active
December 21, 2015 10:19
-
-
Save ghawkgu/6291273 to your computer and use it in GitHub Desktop.
Retrieve single file from remote repository with git.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git archive --remote {remote repository} {branch name/tree-ish} {file path} | tar -x --strip-components={directory depth} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use any of the following commands if the tar command does not support --strip-components | |
git archive --remote {remote repository} {branch name/tree-ish} {file path} | tar -x --strip-path={directory depth} | |
(git archive --remote {remote repository} {branch name/tree-ish} {file path} | tar -x -O ) > {file name} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment