Git 大文件存储扩展
git-lfs 把大文件内容存到 LFS 服务端,仓库里只保留指针文件。它适合模型、图片、视频和二进制包;不装 LFS 时克隆到的只是指针。
git lfs install
git lfs track '*.psd'
git add .gitattributes
git add design.psd
git commit -m 'add design'
git lfs ls-files
git lfs status
git lfs pull
git lfs push origin main
git lfs fetch --all
git lfs prune
git lfs migrate import --include='*.zip' --everything
.gitattributes 必须提交;否则其他人克隆后不会走 LFS。git lfs migrate 会改写历史;执行前备份并通知所有协作者。lfs: true),否则构建拿到指针文件。git lfs prune 只删本地缓存,不影响远端;但会影响离线使用。git — 版本控制git-archive — 导出发布包