Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在不克隆存储库的情况下,我们需要从 GIT 存储库的特定分支获取原始文件。从文档中不清楚git archive我们如何从特定分支获取特定文件。
git archive
我们应该怎么做?
您可以使用git archive和使用--来指定分支中的文件。
--
命令是:
git archive --remote=<repo> <branch> -- <path/to/file> | tar -xO
这输出到 STDOUT,您可以从那里重定向...