Git LFS 2.5.0 is now available
Git LFS 2.5.0 comes with three new migration modes, a handful of bug fixes, and more.
![](https://github.blog/wp-content/uploads/2018/07/43219998-6edaff10-900e-11e8-8249-c3ff9d37be2e.png?resize=1600%2C850)
A new version of Git LFS, the open-source Git extension for versioning large files, is now available. Git LFS v2.5.0 comes with three new migration modes, a handful of bug fixes, and more.
New migration modes
With v2.5.0, you can use the git lfs migrate
command in a few new ways.
Sometimes repositories can get into a broken state when large files that should have been committed with Git LFS aren’t. If your file is over 100 MB, you won’t be able to push to GitHub, and your history will require rewriting with git lfs migrate import
. If you have a file smaller than 100 MB, you can use git lfs migrate import --no-rewrite
to create new commits that move the file to Git LFS, allowing you to repair the state of your repository more easily than ever.
If you have committed a handful of files that should have been stored with Git LFS, but aren’t, you can let Git LFS determine the affected files for you by running git lfs migrate import --fixup
. The --fixup
flag automatically reads .gitattributes
file(s) in your repository, and converts Git objects that should be stored with Git LFS automatically:
In the following example, notice how our .gitattributes file says that *.png
‘s should be tracked using Git LFS, but we added mona.png without Git LFS:
$ cat .gitattributes
*.png filter=lfs diff=lfs merge=lfs -text
$ git cat-file -p :mona.png | file -s
/dev/stdin: PNG image data, 896 x 896, 8-bit/color RGBA, non-interlaced
We can easily fix this without having to tell Git LFS which files to start tracking:
$ git lfs migrate import --fixup
migrate: Fetching remote refs: ..., done
migrate: Sorting commits: ..., done
migrate: Rewriting commits: 100% (2/2), done
master 1002728154804338fe645976ad8b7258b0be0810 -> 076e2bfe114df5575b1130f694c18d1b26c86b86
migrate: Updating refs: ..., done
migrate: checkout: ..., done
$ git cat-file -p :mona.png
version https://git-lfs.github.com/spec/v1
oid sha256:49afbfc61b10df78377f8f7dac774158e1a0197740e160ea3572d9839c61ac04
size 106277
Now mona.png is stored correctly using Git LFS!
Lastly, if you want to stop using Git LFS and export your large objects, you can use git lfs migrate export
. It accepts the same arguments as git lfs migrate import
, and easily allows you to take files out of Git LFS.
Developer ergonomics
We have updated several of the scripts and programs used to develop and hack on Git LFS to feel more familiar to open source contributors. The test suite now outputs results using the TAP format, enabling it to be run with prove
. Similarly, the project can now be built using a Makefile
, which should feel more familiar to developers comfortable working with Git.
Additional updates
You’ll see a handful of other new features and bug fixes in v2.5.0 like improved support for object alternates, correct git lfs status
output from subdirectories, and more.
For instructions on configuring Git LFS, refer to this article.
Tags:
Written by
Related posts
![](https://github.blog/wp-content/uploads/2024/05/Collaboration-LightMode-3.png?resize=400%2C212)
How to build an open source metrics dashboard
How GitHub volunteers built an open source metrics dashboard for the World Health Organization and some best practices they picked up along the way.
![](https://github.blog/wp-content/uploads/2024/05/Collaboration-LightMode-2-1.png?resize=400%2C212)
Automating open source: How Ersilia distributes AI models to advance global health equity
Discover how the Ersilia Open Source Initiative accelerates drug discovery by using GitHub Actions to disseminate AI/ML models.
![Orange rectangle with the Git logo and white text overlaid, which reads "Git 2.46 is here!"](https://github.blog/wp-content/uploads/2024/07/git-246.png?resize=400%2C212)
Highlights from Git 2.46
Git 2.46 is here with new features like pseudo-merge bitmaps, more capable credential helpers, and a new git config command. Check out our coverage on some of the highlights here.