git-lfs无法push 大文件 ?

vim_vim 2018-01-17 12:09:27
cd /tmp/back
ls -al
total 145636
drwxr-xr-x 2 xxx xxx 4096 Jan 17 11:04 .
drwxrwxrwt 18 root root 4096 Jan 17 10:44 ..
-rw-r--r-- 1 root root 45 Jan 16 18:40 imitation.tar.gz
-rw-r--r-- 1 root root 146996064 Jan 16 18:40 wp.bak.tar.gz
-rw-r--r-- 1 xxx xxx 2114053 Jan 16 18:40 wp.sql.bak.tar.gz

wp.bak.tar.gz 是一个 140M 的大文件

我现在想把整个/tmp/back 文件夹中的文件全部,push到我的github.

1.install lfs
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
git lfs install

2.push /tmp/back 中的所有文件

cd /tmp/back
git init
git lfs track ./wp.bak.tar.gz
git add .gitattributes
git add *
git commit -m "Add large file"
git remote add origin https://github.com/xxxx/yyyy.git
git push origin master

出现下面的错误
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 751fb70b058bd398791f7a04ba313ea5
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File wp.bak.tar.gz is 140.19 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/xxxx/yyyy.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/xxxx/yyyy.git'


请问,如何处理?
...全文
878 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
maniao1991 2020-03-20
  • 打赏
  • 举报
回复

git reset 74b23cf15f432f3b694704292511bc75647d7457
git add .gitattributes
git add libYouTuMediaPlayerEngineYouku.a
//fatal: pathspec 'libYouTuMediaPlayerEngineYouku.a' did not match any files
 git add /Users/apple/Desktop/lianxiangaichongvideo/DoYin/Pods/YKMediaPlayerSDK/YouTuEngineMediaPlayer/libYouTuMediaPlayerEngineYouku.a 
git commit -m "Add design file"
/*
[gitattributes 5736497] Add design file
 2 files changed, 7 insertions(+)
 create mode 100644 .gitattributes
 create mode 100644 DoYin/Pods/YKMediaPlayerSDK/YouTuEngineMediaPlayer/libYouTuMediaPlayerEngineYouku.a
*/
git push origin master
/*
Enumerating objects: 1991, done.
Counting objects: 100% (1991/1991), done.
Delta compression using up to 4 threads
Compressing objects: 100% (1932/1932), done.
Writing objects: 100% (1990/1990), 96.17 MiB | 1.41 MiB/s, done.
Total 1990 (delta 400), reused 0 (delta 0)
remote: Resolving deltas: 100% (400/400), done.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: c73f98e2e672558e83ebcb97995a7325
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File DoYin/Pods/YKMediaPlayerSDK/YouTuEngineMediaPlayer/libYouTuMediaPlayerEngineYouku.a is 185.03 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/**.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/**.git'
*/
我也没有上传上,同上。

1,265

社区成员

发帖
与我相关
我的任务
社区描述
软件工程/管理 管理版
社区管理员
  • 研发管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧