I did a clone of a remote without a checkout:
git clone -n [email protected]:RobKohr/awesome-repo.git
and can clone an individual file:
git checkout HEAD README.md
but I would like to get a list of all the files in the repo without fetching the files themselves.
Is there a way to do this?
This is for a rather large private github repo that I only have ssh deploy access to (not web access), and I don't want to check out the whole thing. I want to get the file list so I can pick and choose.
There are only two ways to do that — either using clone or via Github API. If you don't have access to the API clone is the only solution.
You can speed things up a bit using shallow clone. Do not clone the entire repository — clone only the last commit into a bare repository and run git ls-tree:
git clone --bare --depth=1 [email protected]:RobKohr/awesome-repo.git
cd awesome-repo.git
git ls-tree --name-only -r HEAD
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With