Package: git-fat
A tool for managing large binary files in git repositories.IntroductionGit-fat is a tool written byjedbrown.
This repository / pypi package is a fork which we areactively trying to resolve.
With that said, the repository placeholder format is compatible with both, so
they should be interchangeable for now.  Please take care to check which one
you are using before opening issues on either repository, and include as much
information as possible so that we are able to help you as best we can.Now an explanation about what (either)git-fatdoes:Checking large binary files into a distributed version control system is
a bad idea because repository size quickly becomes unmanageable. Numerous
operations take longer to complete and fresh clones become something
that you start and wait for a bit before coming back to them.
Usinggit-fatallows you to separate the storage of large-files from
the source while still having them in the working directory for your project.FeaturesCloning the source code remains fast because binaries are not
includedBinary files really exist in your working directory and are not
soft-linksOnly depends on Python 2.7 and a backendSupports anonymous downloads of files over httpCompatibilityOS support: Linux, Mac, Windows.Python support: only 2.xInstallationYou can installgit-fatusing pip.pip install git-fatOr you can install it simply by placing it on your path.curl https://raw.github.com/cyaninc/git-fat/master/git_fat/git_fat.py \
| sudo tee /usr/local/bin/git-fat && sudo chmod +x /usr/local/bin/git-fatInstallation on WindowsTo install from PyPI type:pip install --upgrade git-fatIt is required for the Python27/Scripts directory to be in PATH.See also other scripts in the win32/ directory:install_win.py - this script ensures that a binary wheel package (.whl)
is installed from PyPI. If for example there is a Linux source package
(.tar.gz) available and its version number is higher than any of the
available .whl packages, then the pip tool would install the Linux
source package and for obvious reasons it wouldn’t work.run_tests_xxx.bat - run unit testssetup.bat - install package from sourcessetup_wheel.bat - create a binary Python Wheel package in the dist/
directory and install that packageUsageFirst, create agit attributesfile in the root of your repository. This file determines which files
get converted togit-fatfiles.cat >> .gitattributes <<EOF
*.deb filter=fat -crlf
*.gz filter=fat -crlf
*.zip filter=fat -crlf
EOFNext, create a.gitfatconfiguration file in the root of your repo
that contains the location of the remote store for the binary files.
Optionally include the ssh user and port if non-standard. Also,
optionally include an http remote for anonymous clones.[rsync]
remote = storage.example.com:/path/to/store
user = git
port = 2222
[http]
remote = http://storage.example.com/storeCommit those files so that others will be able to use them.Initialize the repository. This adds a line to.git/configtelling
git what command to run for thefatfilter is in the.gitattributesfile.git fat initNow when you add a file that matches a pattern in the.gitattributesfile, it will be converted to a fat placeholder file before getting
committed to the repository. After you’ve added a fileremember to push
it to the fat store, otherwise people won’t get the binary file when
they try to pull fat-files.git fat pushAfter we’ve done a new clone of a repository usinggit-fat, to get
the additional files we do a fat pull.  This will pull the default backend
as determined by the first entry in the.gitfatfile for the repo.git fat pullTo specify which backend to use when pulling or pushing files, then simply
list the backend type after the pull or push command.git fat pull httpTo list the files managed bygit-fatgit fat listTo get a summary of the orphan and stale files in the repositorygit fat statusOrphans are files that exist as placeholders in the working copy. Stale
files are files that are in the.git/fat/objectsdirectory, but have
no working copy associated with them (e.g. old versions of files).To find files over a certain size, use git fat find. This example finds
all objects greater than 10MB in git’s database and prints them out.git fat find 10485760Implementation notesFor many commands,git-fatby default only checks the currentHEADfor placeholder files to clone. This can save on bandwidth for
frequently changing large files and also saves on processing time for
very large repositories. To force commands to search the entire history
for placeholders and pull all files, callgit-fatwith-a. e.g.git fat -a pullIf you addgit-fatto an existing repository, the default behavior
is to not convert existing binary files togit-fat. Converting a
file that already exists in the history for git would not save any
space. Once the file is changed or renamed, it will then be added to the
fat store.To setup an http server to acceptgit-fatrequests, just configure a
webserver to have a url serve up thegit-fatdirectory on the
server, and point the.gitfathttp remote to that url.Retroactive ImportYou can retroactively import a repository togit-fatusing a combination
offindandindex-filterused with git’sfilter-branchcommand.Before you do this, make sure you understand the consequences ofrewriting historyand be sure to
backup your repository before starting.First, clone the repository and find all the large files with thegit fat findcommand.darthurdent at betelgeuse in /tmp/git-fat-demo (master)
$ git fat find 5123123
761a63bf287867da92eb420fca515363c4b02ad1 9437184 flowerpot.tar.gz
6c5d4031e03408e34ae476c5053ee497a91ac37b 10485760 whale.tar.gzReview the files and make sure that they’re what you want to exclude from the
repository.  If the list looks good, put the file names into another file that
will be read from duringfilter-branch.darthurdent at betelgeuse in /tmp/git-fat-demo (master)
$ git fat find 5123123 | cut -d' ' -f3- > /tmp/towel

darthurdent at betelgeuse in /tmp/git-fat-demo (master)
$ cat /tmp/towel
flowerpot.tar.gz
whale.tar.gz

darthurdent at betelgeuse in /tmp/git-fat-demo (master)
$ ll
total 19M
drwxrwxr-x 3 darthurdent darthurdent 4.0K Dec 10 13:42 .
drwxrwxrwt 6 root         root          76K Dec 10 13:42 ..
drwxrwxr-x 6 darthurdent darthurdent 4.0K Dec 10 13:42 .git
-rw-r--r-- 1 darthurdent darthurdent 9.0M Dec 10 13:37 flowerpot.tar.gz
-rw-r--r-- 1 darthurdent darthurdent  10M Dec 10 13:37 whale.tar.gzDo thefilter-branchusinggit fatindex-filteras the index filter.
Pass in the file name containing the paths to files you want to exclude.darthurdent at betelgeuse in /tmp/git-fat-demo (master)
$ git filter-branch --index-filter 'git fat index-filter /tmp/towel'\
    --tag-name-filter cat -- --all
Rewrite 28cfba441aac92992c3f80dae97cd1c19b3befad (2/2)
Ref 'refs/heads/master' was rewrittenReview the changes made to the repository.darthurdent at betelgeuse in /tmp/git-fat-demo (master)
$ ll
total 19M
drwxrwxr-x 3 darthurdent darthurdent 4.0K Dec 10 13:42 .
drwxrwxrwt 6 root         root          76K Dec 10 13:42 ..
drwxrwxr-x 6 darthurdent darthurdent 4.0K Dec 10 13:42 .git
-rw-rw-r-- 1 darthurdent darthurdent   64 Dec 10 13:42 .gitattributes
-rw-rw-r-- 1 darthurdent darthurdent 9.0M Dec 10 13:42 flowerpot.tar.gz
-rw-rw-r-- 1 darthurdent darthurdent  10M Dec 10 13:42 whale.tar.gz

darthurdent at betelgeuse in /tmp/git-fat-demo (master)
$ cat .gitattributes
flowerpot.tar.gz filter=fat -text
whale.tar.gz filter=fat -text

darthurdent at betelgeuse in /tmp/git-fat-demo (master)
$ git cat-file -p $(git hash-object whale.tar.gz)
#$# git-fat 8c206a1a87599f532ce68675536f0b1546900d7a             10485760Remove all the old and dangling references by doing a clone of the repository
you just cleaned.  Thefile://uri isimportanthere.darthurdent at betelgeuse in /tmp/git-fat-demo (master)
$ cd .. && git clone file://git-fat-demo git-fat-cleanRelated projectsgit-annexis a far more
comprehensive solution, but was designed for a more distributed use
case and has more dependencies.git-mediaadopts a similar
approach togit-fat, but with a different synchronization
philosophy and with many Ruby dependencies.DevelopmentTo run the tests, simply runpython setup.py test.To use the development version ofgit-fatfor manual testing, runpip install-U.(suggest doing that in a virtualenv).Master branch is a stable branch with the latest release at the HEAD.ImprovementsBetter Documentation (esp. setting up a server)Improved Testingconfig file location argument (global)cli option to specify which backend to use for push and pull (http, rsync, etc)Python 3 compatibility (without six)Really implement pattern matchingGit hooks