【发布时间】:2010-11-10 15:52:15
【问题描述】:
从远程 git 存储库获取单个文件的内容的最有效机制(就传输的数据和使用的磁盘空间而言)是什么?
到目前为止,我已经设法提出:
git clone --no-checkout --depth 1 git@github.com:foo/bar.git && cd bar && git show HEAD:path/to/file.txt
这似乎还是有点矫枉过正。
从 repo 中获取多个文件怎么样?
【问题讨论】:
-
啊。如果有一个内置的方法来做相当于“cat-remote”和“tag-remote”,我会喜欢的。
-
我有同样的问题我想在 2 个 repos 中拥有相同的许可证文件;在 1 个 repo 中编辑文件,然后让它自动更新另一个 repo 中的副本。
标签: git git-checkout sparse-checkout git-sparse-checkout