Reputation: 6057
I am doing a video player. I have the following in my project folder:
these four dirs should each be on their own line: /source /sample_applications /images /videos
Right now the repo just includes the /source directory...which is code only.
It is on my local computer. I am thinking of adding it to git hub.
My question is: should I add the sample apps, the images and the videos to the repo? Is that something that people normally do and that other people want people to do? Can git even handle videos(noob here)?
Upvotes: 4
Views: 1147
Reputation: 76520
It depends on how big the binary files are. If they add up to ten or twenty MB than you should be OK. If there are hundreds of megabytes of video and images then it'll blow up the size of the repo quite dramatically.
Git compresses all the files and only stores diffs between revisions. This works really well for text, not so much with binaries. If there is a slight change in the files it's quite likely the diff algorithm is not going to make a perfect diff, but add a whole new version. This is even worse for video as it is already very aggressively compressed and thus will not take advantage of git compression. Expect the size of your repository to be that of a sum of all the video files' sizes.
Another thing about got is that whenever you clone, the whole copy of the repository hers transmitted. Again, this becomes an issue with a big repository.
If, however, the size is not an issue I would highly recommend to put these binary files into a separate repository and link it to the sourse repo using got submodules. This way your source repo stays nice and small, giving you the freedom to handle binaries in some other way in the future.
Upvotes: 3
Reputation: 33187
And yes, git does fine with binary data.
Upvotes: 1
Reputation: 193
Here is a similar question on stack overflow:
Managing large binary files with git
In short, yes it can handle binary files (read video), but if they are large it might be a hassle for people when they initially clone your repo. If they are small, and will be useful for programmers using your program in most situations, then it may be a good idea to add them to a repo. If they are large and necessary there is a discussion on that page about using a git-submodule to manage the video part of the repo.
Upvotes: 3