如何将文件存储在Git存储库中而不被跟踪,同时又保持最新状态? [英] How can a file be stored in a Git repository without being tracked *while also* being kept up-to-date?

查看:85
本文介绍了如何将文件存储在Git存储库中而不被跟踪,同时又保持最新状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Git存储库中存储了一个大型数据库文件.此文件将定期更新并保存到资源库中.我不希望Git现在跟踪该文件的更改,尽管我确实希望文件存储在存储库中并且是最新的.与其使用Git跟踪数据库的更改(导致存储库的大小显着增加),不如保存一个偶尔的数据库发布"副本.

I have a large database file stored in a Git repository. This file is updated and saved to the repository regularly. I do not want Git to keep track of the changes to this file now, though I do want the file to be stored in the repository and to be up-to-date. Instead of keeping track of the changes to the database using Git (resulting in the size of the repository increasing considerably), it is preferable to save an occasional "release" copy of the database.

该如何完成?请注意,此问题不是 ,而是简单地

How should this be done? Note that this question is not asking simply how to stop tracking a file; the file in the repository must be kept up-to-date.

推荐答案

这听起来像是Git LFS的工作. Git LFS旨在处理大文件并对其进行版本控制.您不仅可以将文件存储在git中,而且可以在不进行版本跟踪的情况下保持最新状态.

This sounds like a job for Git LFS. Git LFS is designed to handle large files and version them. You can't just store a file in git and keep it up-to-date with with out version tracking.

https://git-lfs.github.com/

这篇关于如何将文件存储在Git存储库中而不被跟踪,同时又保持最新状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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