如何标记单个文件?或如何下载特定文件? -GIT [英] How to tag a single file? or How do I download a specific file? - GIT

查看:152
本文介绍了如何标记单个文件?或如何下载特定文件? -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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆