How do I handle binary files with git?

Asked 1 years ago, Updated 1 years ago, 38 views

If you use videos with git, the source tree may become bloated and won't work.

It says that gitmedia is good when I search online, but how does it work?

git

2022-09-30 19:12

3 Answers

I think using Git Large File Storage is a good idea.

Git Large File Storage is an open-source Git extension designed to improve the "incorporation of large-capacity binary files such as audio samples and datasets, graphics and video" in Git workflows.

The fee is free up to 1GB.Starting at $5 a month for 50GB.Please refer to Price List for more information as the transfer fee is set separately set.

That's right.

Note:
Git Large File Storage official release - Publickey http://www.publickey1.jp/blog/15/git_lfs.html
for GitHub and Git to handle large files such as images and videos Git Large File Storage https://git-lfs.github.com/


2022-09-30 19:12

Assume that the situation is as follows.

  • There are lots of images, videos and more in the web development project.
  • Editing images and videos is managed separately from the source code, and only finalized images are placed on the source tree.
  • Git wants to manage source code

*Please ignore this answer if the main purpose of managing videos is to manage source code.

If the number of files is large, but git is not too much to handle, manage them separately with submodule.

"If ""image history doesn't have to follow up so much in real time"" in a situation where there are a lot of images, I wonder if it will be possible to avoid problems such as taking a long time to develop by submodule and pulling the submodule side when I feel like it."

Don't manage with git if it's too much to handle.

It is easy to remove from git management and treat it as a separate layer such as configuration management.

  • During development, a directory containing large files such as /movie/ on the web server side will be referred to the NFS directory.(Always up to date on NFS)
  • If you want to keep a history of files that exist at the time of release in a production release, you can use chef or scripts to automate.
  • Use Git hook if you want to work with git.

"How do you want to manage the video for what purpose and with what priority?" But I think it's best to leave it outside the basic git repository.


2022-09-30 19:12

As some people have said, it is better not to use git for videos.
If you still want to manage the video version with git, I think that means:

<-> Once committed videos can be restored at any time

If you can accept the disadvantages (the pressure on space resources due to the accumulation of videos), using git-media is also an option.

Simply put, git-media works by storing a huge file somewhere else when it is about to be added to history and keeping only the link to it as git history.

This makes it relatively easy to work around, for example, when you clone and check out, you only need to retrieve the historical + current revision giant objects that do not have a giant object.

Now, it's where the giant files are going to be stored, but it's going to be placed in S3 and the right file storage area (connected by rsync).This of course gets bigger and bigger.

Note that git media solves the problem of poor repository handling due to sourceTree enlargement, not the "total size of files stored."


2022-09-30 19:12

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.