0

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.

Community
  • 1
  • 1
d3pd
  • 7,935
  • 24
  • 76
  • 127
  • Possible duplicate of [Keep file in a Git repo, but don't track changes](https://stackoverflow.com/questions/9794931/keep-file-in-a-git-repo-but-dont-track-changes) – samm Mar 22 '19 at 02:59
  • Possible duplicate of [git : push a file to openshift online without tracking its changes](https://stackoverflow.com/questions/35770403/git-push-a-file-to-openshift-online-without-tracking-its-changes) – samm Mar 22 '19 at 03:20

1 Answers1

2

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/

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
  • Note you can [use the BFG to retroactively put all past revisions of large files into LFS](https://github.com/rtyley/bfg-repo-cleaner/releases/tag/v1.12.5). – Schwern Dec 14 '16 at 21:07