Skip to content

Instantly share code, notes, and snippets.

@nepsilon
Created June 6, 2017 10:54
Show Gist options
  • Save nepsilon/7c44e8fc597eed97e71174d6d67a5617 to your computer and use it in GitHub Desktop.
Save nepsilon/7c44e8fc597eed97e71174d6d67a5617 to your computer and use it in GitHub Desktop.
How to track large files (database, PSD, bin) in Git? — First published in fullweb.io issue #103

How to track large files (database, PSD, bin) in Git?

Sometimes you have PSD or a small-ish SQLite file you’d like to track with Git. The problem is Git is bad at tracking changes in big binary files by default. With Git Large File Storage (LFS) you can replace these large files with text pointers while storing the file contents on a remote server. Both GitHub and BitBucket support it. Here is how to get started:

1. Install Git LFS extension (Mac here):

brew install git-lfs

2. In your repo run git lfs:

cd repo
git lfs install

3. Set the file patterns you want LFS to handle. This will create a .gitattributes file, make sure you track it too.

git lfs track "*.psd"

4. You’re all set! From there just use regular git commands:

git add design.psd
git commit -m "Add design file"
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment