0%

Github lfs使用

GitHub不允许直接上传大文件(超过100M)的文件到远程仓库,若要想继续提交可以尝试使用大文件支持库(Large File System)

它将你所标记的大文件保存至另外的仓库,而在主仓库仅保留其轻量级指针.
那么在你检出版本时,根据指针的变化情况下更新对应的大文件.而不是在本地保存所有版本的大文件

https://blog.csdn.net/leenhem/article/details/117380399

执行 git lfs install 开启lfs功能
使用 git lfs track 命令进行大文件追踪 例如git lfs track “*.png” 追踪所有后缀为png的文件
使用 git lfs track 查看现有的文件追踪模式
提交代码需要将gitattributes文件提交至仓库. 它保存了文件的追踪记录
提交后运行git lfs ls-files 可以显示当前跟踪的文件列表
将代码 push 到远程仓库后,LFS 跟踪的文件会以『Git LFS』的形式显示:
clone 时 使用’git clone’ 或 git lfs clone均可

1
2
3
4
5
6
7
8
9
10
11
git lfs track *.png



git add .gitattributes



git add xxx
git commit -m "update"
git push origin master