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'
請問,如何處理?
uj5u.com熱心網友回復:
我也沒有上傳上,同上。
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'
*/
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/81620.html
標籤:研發管理
