如何标记单个文件?或如何下载特定文件? -GIT [英] How to tag a single file? or How do I download a specific file? - GIT
问题描述
我想在文件中添加标签以轻松下载该文件,而不是整个分支.
I would like to add a tag to a file to easily download that file and not the entire branch.
如何在GIT中下载特定文件?
How do I download a specific file in GIT?
推荐答案
我不知道有什么方法可以标记git
中的特定文件.
I am not aware of any way to tag specific files in git
.
第二个问题:如何在git
中下载特定文件?
For the second question: How do I download a specific file in git
?
仅当您的意思是在 在git
存储库中下载时",以下内容才有效(这就是我对您的问题的理解,如果您的意思是 with git无需存储库,请参见从远程git存储库中获取单个文件
或无法从中提取单个文件远程git服务器
)
The following works only if you mean "download while in a git
repository" (That's how I understand your question, if you mean with git without having the repository see Get a single file from a remote git repository
or Not able to extract single file from remote git server
)
$ git checkout tagged-commit -- path/to/file.example
tagged-commit
可能有很多东西,其中包括:
Where tagged-commit
can be a lot of things, among others:
- 提交哈希
- 一个git标签
- 分支名称
- 有关更多方法,请参见 gitrevisions
- A commit hash
- A git tag
- A branch name
- For more ways see gitrevisions
这篇关于如何标记单个文件?或如何下载特定文件? -GIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!