Tip: Git LFS space is limited, so please use it to manager REAL large files whose size is greater than 100MB.
# init git
git init
# init lfs
git lfs install
# track specific file types
git lfs track *.fbx
git lfs track *.mp4
# lookup what types are tracked
git lfs track
# add .gitattributes file first
git add .gitattributes
# add other files
git add .
# commit
git commit -m "this is the commit message"
# push
git push -u origin master
# Just in case, run the following and run `git push -u origin master` again
git lfs push origin master --all
Same as
For an empty project
git lfs migrate import --include="*.fbx" --include-ref=refs/heads/master
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD
Not working, I don't know why.
# track files which are greater than 100MB
find * -type f -size +100M -exec git lfs track --filename '{}' +
# add files which are greater than 100MB
find * -type f -size +100M -exec git add '{}' +
I researched and found that maybe git lfs did not support track specific files expected files like
Assets/Model/*.fbx
.
# download
git lfs fetch
# revert to original file type
git lfs checkout