Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 513 Bytes

2023-03-03-single-file-git.md

File metadata and controls

15 lines (13 loc) · 513 Bytes
date title draft categories tags
2023-03-03 00:00:00 -0500
git single file
false
daily
git

Sometimes you just need a single file from a git repo. I know that this is not the typical way we use git, but sometimes you just need to do a thing.
So I want a single file, how do i do that?

git archive --format=tar --remote=ssh://git@github.com:someuser/somefile.git{main} -- my_file_name |tar xf -

and like that you can snag one file from one repo and get on with your life.