突破GitHub的限制,使用 git-lfs(Git Large File Storage) 支持单个文件超过100M
但是GitHub 目前 Git LFS的总存储量为1G左右,超过需要付费。(上传失败时,可以开启VPN进行上传)
$ git lfs install
$ git init
$ git lfs track tinyos.tar
"tinyos.tar" already supported
tinyos.tar为笔者电脑中大于100MB的文件(tinyos 镜像文件),github无法备份
$ git add .
$ git commit -m "add large file"
$ git push
此后lfs传上去的大文件,pull
需要使用:
$ git lfs pull
Remote “origin” does not support the LFS locking API. Consider disabling it with
$ git push -u origin main
Remote "origin" does not support the LFS locking API. Consider disabling it with:$ git config lfs.https://github.com/Aaaazdy/docker-repository.git/info/lfs.locksverify false
Post "https://github.com/Aaaazdy/docker-repository.git/info/lfs/locks/verify": dial tcp 192.30.255.112:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
error: failed to push some refs to 'https://github.com/Aaaazdy/docker-repository.git'
Solutions:
git config lfs.https://github.com/Aaaazdy/docker-repository.git/info/lfs.locksverify false
batch request: Access denied
在最后一步push的时候
git push -u origin develop1.0
Remote "origin" does not support the LFS locking API. Consider disabling it with:$ git config lfs.https://git.oschina.net/harrydeng/xxx.git/info/lfs.locksverify false
Git LFS: (0 of 1 files) 0 B / 207.25 MB
batch request: Access denied
exec request failed on channel 0: exit status 255
error: failed to push some refs to 'git@github.com/Aaaazdy/docker-repository.git'
Solutions:
删除 .git/hooks/pre-push 文件即可