LFS 更新 .gitattributes 文件
添加了新的二进制文件,出现错误:
remote: -------------------------------------------------------------------------
remote: Your push was rejected because it contains binary files.
remote: Please use https://git-lfs.github.com/ to store binary files.
remote: See also: https://hf.co/docs/hub/repositories-getting-started#terminal
remote:
remote: Offending files:
remote: - data/audio/***.mp3 (ref:
refs/heads/main)
remote: -------------------------------------------------------------------------
To hf.co:spaces/dubox/node-clients
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'hf.co:spaces/dubox/node-clients'
需要更新 .gitattributes 文件,以MP3为例,增加一行:
*.mp3 filter=lfs diff=lfs merge=lfs -text
然后,强制重新跟踪所有MP3文件:
git lfs migrate import --include="*.mp3" --everything
验证跟踪状态:
git lfs ls-files | grep mp3