仅保留 GitHub 上的最新文件

发布于 2025-01-13 01:03:03 字数 139 浏览 3 评论 0原文

有没有可能只保留 GitHub 上某些特定文件的最新版本?

例如,我想将一些 pdf 文件上传到 GitHub,但我不想浪费太多空间来保留这些 pdf 的历史记录。

虽然将二进制文件上传到 GitHub 并不是一个好主意,但确实很方便。

Is there a possible way to keep only the latest version of some specific files on GitHub?

For example, I want to upload some pdf files to GitHub, but I don’t want to waste too much space keeping the history of those pdfs.

Although upload binary files to GitHub is not a good idea, it is really convenient.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

把人绕傻吧 2025-01-20 01:03:03

不,没有办法做到这一点。 Git 旨在跟踪项目的历史记录,如果您不想跟踪历史记录,那么您不应该使用 Git。如果您想存储或保留数据而不存储历史记录,可以使用常规网站或云存储桶。

请注意,Git LFS 对此不是一个好的选择,因为它还会保留历史记录。唯一的区别是您不使用的文件不在本地计算机上;而是在本地计算机上。它们只保存在服务器上。如果您不想保留历史记录,那么在任何地方(即使在服务器上)保留旧版本也是没有意义的。

No, there is no way to do that. Git is designed to track the history of a project, and if you don't want to track history, then you should not use Git. You can use a regular website, or a cloud bucket, if you'd like to store or persist data without storing history.

Note that Git LFS is not a good choice for this, because it also keeps history. The only difference is that files that you aren't using aren't on your local machine; they're only kept on the server. If you don't want to keep history, then there's no point in persisting old versions anywhere, even on the server.

快乐很简单 2025-01-20 01:03:03

使用 git-lfs 存储大文件而不会使存储库膨胀。

或者考虑这是否适合使用 Git;或许可以使用 Amazon S3 等云存储来代替。

Use git-lfs to store large files without bloating the repository.

Or consider whether this is an appropriate use of Git; perhaps use cloud storage such as Amazon S3 instead.

原来分手还会想你 2025-01-20 01:03:03

使用 git-lfs 存储大文件而不会使存储库膨胀。

在 Git 项目中存储大型 blob 时需要小心。 Github 发布了一些关于此的指南......

Use git-lfs to store large files without bloating the repository.

You need to be careful storing large blobs inside of Git projects. Github publishes some guidelines around this...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文