Skip to content

Instantly share code, notes, and snippets.

@wcarhart
Last active February 6, 2020 23:52
Show Gist options
  • Save wcarhart/faf8404f4791f3e6918628b9366d2e7f to your computer and use it in GitHub Desktop.
Save wcarhart/faf8404f4791f3e6918628b9366d2e7f to your computer and use it in GitHub Desktop.
Initialize Git LFS and start tracking files with it
# Initialize Git LFS and start tracking files with it
## Install Git LFS (MacOS)
brew install git-lfs
## Change to repository
cd $PROJECT_REPO
## If you've already added or committed the file(s) you'd like to track with LFS,
## you'll need to edit them out of the Git history. See:
## https://gist.github.com/wcarhart/0c8106fbff33e747400cf7a6edcb2847
## Initialize Git LFS
git lfs install
## Track desired file
git lfs track $VERY_BIG_FILE
## Add .gitattributes to history
git add .gitattributes
## Continue as normal
git add -A
git commit -m "Initialized LFS"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment