Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git LFS at Autodesk

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Git LFS at Autodesk

Avatar for Lars Schneider

Lars Schneider

December 08, 2016
Tweet

More Decks by Lars Schneider

Other Decks in Programming

Transcript

  1. @kit3bus • Best known for AutoCAD
 2D and 3D computer-aided

    design
 • 33 years in business
 • 4000 engineers, hundreds of products, terabytes of code and asset data Lars Schneider Autodesk Inc.
  2. @kit3bus Why are large files a problem? All history is

    local. Good for source files. Problem for large files.
  3. @kit3bus What files are not suited 
 for Git? Files

    that do not compress well and change frequently. ...
  4. @kit3bus Mon Tue Wed What files are not suited 


    for Git? Files that do not compress well and change frequently.
  5. @kit3bus Example: Git repo
 with large files code code Git

    Repo master code code 301MB code code
  6. @kit3bus 1 MB Example: Git LFS repo with large files

    master LFS Server LFS Ptr code Git LFS Repo LFS Ptr code code code code LFS Ptr code
  7. @kit3bus 1 MB Example: Git LFS repo with large files

    master LFS Server LFS Ptr code LFS Ptr code code code code LFS Ptr code Git LFS Repo Clone
  8. @kit3bus 1 MB Example: Git LFS repo with large files

    master LFS Server LFS Ptr code LFS Ptr code code code code LFS Ptr code Git LFS Repo Clone + Checkout
  9. @kit3bus What do we use Git LFS for? Integration Test

    Data
 (3D Models, ...) Auxiliary Data
 (Documentation, Images, Videos, ...) Build Artifacts
 (not recommended)
  10. @kit3bus Migration Process 1 Identify an engineer with deep code

    knowledge Create a "demo" migration on Git migration server Iterate on "demo" migration until repo and CI are OK Ask broader team to "play" with the "demo" migration Perform migration on Git production server 2 3 4 5
  11. @kit3bus How to migrate? + git-svn / git-p4 / git-tfs

    ... git filter branch / git-lfs-migrate
  12. @kit3bus How to migrate? + git-p4 git-svn / git-p4 /

    git-tfs ... git filter branch / git-lfs-migrate
  13. @kit3bus Git LFS
 migration gotchas master LFS Ptr code LFS

    Server Git LFS Repo Avoid "orphaned" LFS files
  14. @kit3bus Mon Tue Wed Teach why "Large" files are a

    problem! Files that do not compress well and change frequently.
  15. @kit3bus Files smaller than 500kb are OK. Rule of Thumb

    Teach why "Large" files are a problem!
  16. @kit3bus Less than 1000 files in LFS are OK. Rule

    of Thumb How to track Git LFS files?
  17. @kit3bus Less than 1000 files in LFS are OK. Rule

    of Thumb How to track Git LFS files? https://autode.sk/git-filter "Git checkout for a test repo with 12k LFS files on Windows takes 57 seconds instead of 55 minutes!" Git 2.11 + GitLFS 1.5
  18. @kit3bus git lfs track "*.png" git lfs track "*.[pP][nN][gG]" Case

    sensitive: Case in-sensitive: Git LFS 
 Tips & Tricks
  19. @kit3bus No line ending conversions on LFS files! Git LFS

    
 Tips & Tricks FirstLine SecondLine FirstLine▯SecondLine
 Windows macOS
  20. @kit3bus How to make sure Git LFS is used properly?

    Setup Git LFS on all dev machines! Enterprise Config for Git
 https://autode.sk/git LFS Ptr
  21. @kit3bus How to make sure Git LFS is used properly?

    "What happens in Git, stays in Git."
  22. @kit3bus How to make sure Git LFS is used properly?

    Rewriting history can cause a lot of trouble!
  23. @kit3bus How to make sure Git LFS is used properly?

    Configure file size limit on Git server!
  24. @kit3bus How to make sure Git LFS is used properly?

    Configure file size limit with local
 Git pre-commit hooks!
  25. @kit3bus How to make sure Git LFS is used properly?

    Initially, perform Git LFS usage reviews.
  26. @kit3bus Takeaways • Git LFS works at scale
 • Use

    the latest Git/Git LFS versions
 • Automate Git LFS setup
 https://autode.sk/git • Use fast clone command
 git lfs clone <URL> • Use smart tracking patterns
 git lfs track "*.lfs.*" • Reject large files in Git