What to add to git repo?

I am making a video player. My project folder has the following:

these four dirs should be on their own line: / source / sample _applications / images / video

Right now, the repo just includes the / source directory ... which is just code.

This is on my local computer. I am going to add it to a git hub.

My question is: should I add sample applications, images and videos to the repo? Is that what people usually do and what other people want people to do? Can git handle video (noob here)?

+4
source share
3 answers

Here is a similar stack overflow question:

Managing large binaries with git

In short, yes, it can process binary files (read videos), but if they are large, it can be a problem for people when they initially clone your repo. If they are small and useful to programmers using your program in most situations, then it might be a good idea to add them to the repo. If they are large and necessary, this page discusses the use of git substitution to control the repo video object.

+3
source

It depends on how big the binaries are. If they are up to ten or twenty million, then you should be fine. If there are hundreds of megabytes of video and images, then this will dramatically increase the size of the repo.

Git compresses all files and only saves the differences between versions. This works well for text, not just binary files. If there are small changes to the files, it is likely that the diff algorithm will not make perfect diff, but will add a completely new version. This is even worse for the video as it is already very aggressively compressed and thus will not use git compression. Expect your repository to be the sum of all video file sizes.

One more thing is that whenever you clone, the entire copy of the repository that it sends is transmitted. Again, this becomes a problem with large storage.

If, however, size is not an issue, I would strongly recommend putting these binaries in a separate repository and linking it to the sourse repository using the resulting submodules. This way, your source repo remains nice and small, giving you the freedom to use binary files in some other way in the future.

+3
source
  • Sample applications in source form, yes.
  • Images, if they are resources for applications, yes.
  • The video is most likely not. If it is not required to create the application, do not enable it.

And yes, git does a great job with binary data.

+1
source

Source: https://habr.com/ru/post/1309176/


All Articles