git lfs 使用
2023-02-07 本文已影响0人
精巧的中级星光
1 安装过程略,查看是否安装成功
git lfs -v
#输出 git-lfs/3.0.2 (GitHub; windows amd64; go 1.17.2)
- git lfs track ".bigfile" 用于分割的文件类型,一般是 ".mp4"等
目录下输入 git lfs track "*.mp4"
#//输出Listing tracked patterns *.mp4(.gitattributes)
3.会在根目录生成.gitattributes 文件 ,然后正常的add,commit, push 提交
4创建一个大文件进行测试,然后正常的add,commit
dd if=/dev/zero of=dyrone.bigfile bs=1G count=1
5 push,本文重点,push遇到的问题有两个
遇到的问题:
$ git push 后出现的问题
执行git push 后,出现
1:
Uploading LFS objects: 0% (0/2), 0 B | 0 B/s, done.
batch response: Post "https://xxx:***@codeup.aliyun.com/xxx/gitlfs_test.git/info/lfs/objects/batch": x509: certificate signed by unknown authority
error: failed to push some refs to 'https://codeup.aliyun.com/xxxx/gitlfs_test.git'
1解决方式,输入以下
git config --global http.sslVerify false
2:出现lfs没开启的报错
Remote “origin” does not support the LFS locking API.
Consider disabling it with :
$git config lfs.https://XXXRemoteGitURLXXX.git/info/lfs.locksverify false
2:解决:根据报错的提示输入
git config lfs. https://XXXRemoteGitURLXXX.git/info/lfs.locksverify false