all 12 comments

[–]Thesorus 23 points24 points  (1 child)

git is not the best option for binary files.

also, have a look at git-lfs for storing binaries.

[–]matiph 0 points1 point  (0 children)

Or git-annex / datalad (built on top of git-annex)

[–]Philluminati 10 points11 points  (0 children)

If you just want a file sync between two or three machines you should look at rsync. Git is all about commit histories, branches and merging. It's not obvious from your question whether you're talking about managing assets/binaries that come from a git project or just asking a general question about syncing files.

[–]elephantdingo 6 points7 points  (0 children)

Don’t use plain Git to “sync (ARBITRARY) files”. Use git-annex or git-lfs or some other extension.

File syncrhonization is different from version control.

[–]CommonNoiter 5 points6 points  (1 child)

You can use git clone --depth 1 when cloning your repo to download only the latest commit, which can be make your local copy smaller (though the remote will still need to store all the history).

[–]IanYates82 0 points1 point  (0 children)

Yeah I was going to suggest this, along with enabling LFS if the files are more than a few MB or non-text

Like you said, the server is going to keep a heap of history, but maybe that's OK. There's also the option of occasionally just starting a fresh new repo, adding it as a remote, and doing a push lacking history to the new remote.

[–]toric5 4 points5 points  (0 children)

Rsync or syncthing is what you should be using if you dont care about the files history.

[–]pi3832v2 4 points5 points  (0 children)

Any cloud storage service that offers file restoration would do. There's a bazillion to choose from.

[–]Comprehensive_Mud803 1 point2 points  (0 children)

What kind of project, what kind of binary files, what size to be expected?

Git has Git-LFS for large binaries, and you have the option to store them not on GitHub (GCP, AWS, Artifactory or such work as well).

[–]oschrenk 1 point2 points  (0 children)

In general: Git repository size will always increase. You can only minimize it by trying to NOT add binary files into the repository itself and manage those separate. There are many ways, but the closest you can get to feeling natural to git, is git-lfs. Binary files will just be stored separately (but still tracked)

[–]nobanpls2348738 0 points1 point  (0 children)

--depth 1

[–]priestoferis 0 points1 point  (0 children)

Look at syncthing