2020+: use the more recent git sparse-checkout
command (that I introduced here):
This will actually clone without downloading anything:
git clone --filter=blob:none --no-checkout https://github.com/git/git
cd git
I detail the exclusion here:
# Disablecone mode in .git/config.worktree
git config core.sparseCheckoutCone false
# remove .git\info\sparse-checkout
git sparse-checkout disable
# Add the expected pattern, to include just a subfolder without top files:
git sparse-checkout set !/your.exe
# populate working-tree with only the right files:
git read-tree -mu HEAD
2014: You can try a sparse checkout, which means:
- initializing an empty repo,
- add a remote pointing to the GitHub repo:
git remote add -f origin <url>
,
git config core.sparsecheckout true
,
- create a
.git/info/sparse-checkout
file in which you specify what you want to load.
In your case:
/*
!yourExe
You now can do a:
git pull origin master
That should download everything but your exe.