我想克隆一个 GitHub 存储库,其中包含一个巨大的 .exe 文件。 (为什么?!)我对 .exe 文件的使用为零,而且它比其他所有文件的总和要大得多。有没有办法在克隆文件时忽略该文件?
我的猜测是,如果我要求作者制作一个无可执行文件的分支,我会更幸运!希望有一些好的方法可以解决这个问题。
2020+:使用更新的git sparse-checkout command https://git-scm.com/docs/git-sparse-checkout (that 我在这里介绍了 https://stackoverflow.com/a/52916879/6309):
这实际上会克隆without下载任何东西:
git clone --filter=blob:none --no-checkout https://github.com/git/git
cd git
我详细介绍了此处排除 https://stackoverflow.com/a/59515426/6309:
# 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年:你可以尝试一下结账稀疏 https://stackoverflow.com/a/13738951/6309, 意思是:
- 初始化一个空的存储库,
- 添加指向 GitHub 存储库的远程:
git remote add -f origin <url>
,
-
git config core.sparsecheckout true
,
- 创建一个
.git/info/sparse-checkout
您在其中指定要加载的内容的文件。
在你的情况下:
/*
!yourExe
您现在可以执行以下操作:
git pull origin master
那应该下载所有内容but你的exe。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)