I want to see file trees without cloning all remote files. Is it possible using git commands?
git version 2.21.0
My current commands are below:
- mkdir my-repo && cd my-repo
- git init
- git remote add origin https://remote-repo-url
- git fetch
- git checkout origin/master -- '*.html'
How can I get only .html files as fast as I can? My repo is really huge. I need only .html files.
For the existing
my-repo, you could trysparse checkout.Only html files and their parent folders will be left and the others will be hidden.
If you need to do it from scratch, use
git fetch --depth 1to minimize the cost of time and network.If it's a routine task from scratch, you can make a mirror clone in advance to save time and space for future tasks.
And for the routine task,