本文介绍了从存储库中检索单个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是最有效的机制(就数据传输和磁盘空间而言)从远程git存储库获取单个文件的内容?
远远我设法得到:
git clone --no-checkout --depth 1 git@github :foo / bar.git&& cd bar&& git show HEAD:path / to / file.txt这看起来似乎过分了。
如何从repo获取多个文件?
解决方案in git version 1.7.9.5这似乎工作从远程导出单个文件
git archive --remote = ssh:// host / pathto / repo.git HEAD README.md这会捕获文件的内容, README.md 。
What is the most efficient mechanism (in respect to data transferred and disk space used) to get the contents of a single file from a remote git repository?
So far I've managed to come up with:
git clone --no-checkout --depth 1 git@github:foo/bar.git && cd bar && git show HEAD:path/to/file.txtThis still seems overkill.
What about getting multiple files from the repo?
解决方案in git version 1.7.9.5 this seems to work to export a single file from a remote
git archive --remote=ssh://host/pathto/repo.git HEAD README.mdThis will cat the contents of the file README.md.
更多推荐
从存储库中检索单个文件
发布评论