-
Notifications
You must be signed in to change notification settings - Fork 0
gitlfs
Steve edited this page Feb 19, 2019
·
7 revisions
So if you want to use git-lfs in your repo, first you need to have a git-lfs client (follow guide: https://github.com/git-lfs/git-lfs/wiki/Installation).
Assume you have already a cloned repository and you just need to add lfs support:
git lfs install
git add .gitattributes
git commit -m "Added gitattributes for to git-lfs" .
Suppose you have several "*.bz2" files in "data":
git lfs track "*.bz2" # handle bz2 files via git lfs
git rm -r --cached data/*.bz2 # just remove git entries, files will be stored
git add data/*.bz2 # add again, so that git lfs can catch the files
git commit -m "reconverting done to git lfs" .
Edit and/or create a .gitattributes
files (works similar to .gitignore
). For .pptx
and .ppt
files it might look like:
*.ppt* lockable
After that you can manually lock files via:
git lfs lock ./doc/presentation.pptx
# Or use lfs tracking to do that
$ git lfs track "*.ppt*" --lockable # This will add: `*.ppt* filter=lfs diff=lfs merge=lfs -text lockable` to `.gitattributes`
# Do something with it
# ...
git lfs unlock ./doc/presentation.pptx
For more options see: https://github.com/git-lfs/git-lfs/wiki/File-Locking#managing-locked-files
See who has locked any files:
git lfs locks
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License *.
Code (snippets) are licensed under a MIT License *.
* Unless stated otherwise