Github 上传超过100M的大文件 - 简书 (jianshu.com)
看到一个不错的贴子。
29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system
$ git init
Initialized empty Git repository in D:/predict-system/.git/29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git lfs track predict-system.zip
Tracking "predict-system.zip"29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git add .gitattributes29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git commit -m "first"
[master (root-commit) f84f8d9] first1 file changed, 1 insertion(+)create mode 100644 .gitattributes29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git remote add origin https://github.com/Harzerr/Large_scale_Online_Academic_Performance_Prediction_System.git29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git push origin master
fatal: unable to access 'https://github.com/Harzerr/Large_scale_Online_Academic_Performance_Prediction_System.git/': Failed to connect to github.com port 443 after 21040 ms: Couldn't connect to server29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, usegit push --set-upstream origin masterTo have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, usegit push --set-upstream origin masterTo have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git push origin master
Remote "origin" does not support the Git LFS locking API. Consider disabling it with:$ git config lfs.https://github.com/Harzerr/Large_scale_Online_Academic_Performance_Prediction_System.git/info/lfs.locksverify false
Post "https://github.com/Harzerr/Large_scale_Online_Academic_Performance_Prediction_System.git/info/lfs/locks/verify": dial tcp 20.205.243.166: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/Harzerr/Large_scale_Online_Academic_Performance_Prediction_System.git'29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git config lfs.https://github.com/xxx.git/info/lfs.locksverify falsefalse29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Delta compression using up to 8 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 259 bytes | 259.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote:
remote: Create a pull request for 'master' on GitHub by visiting:
remote: https://github.com/Harzerr/Large_scale_Online_Academic_Performance_Prediction_System/pull/new/master
remote:
To https://github.com/Harzerr/Large_scale_Online_Academic_Performance_Prediction_System.git* [new branch] master -> master29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git add .
git commit -m "提交test大文件文件"
git push
[master 571c3f0] 提交test大文件文件1 file changed, 3 insertions(+)create mode 100644 predict-system.zip
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, usegit push --set-upstream origin masterTo have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git add .29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git commit -m "提交test大文件文件"
On branch master
nothing to commit, working tree clean29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git push master
fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git push origin master
batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
Uploading LFS objects: 0% (0/1), 0 B | 0 B/s, done.
error: failed to push some refs to 'https://github.com/Harzerr/Large_scale_Online_Academic_Performance_Prediction_System.git'29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ # 删除 .git/hooks/pre-push 文件即可
That looks like a server issue with deploy keys. For now, try removing .git/hooks/pre-push.
bash: That: command not found29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$ git push origin master
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 8 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 423 bytes | 423.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To https://github.com/Harzerr/Large_scale_Online_Academic_Performance_Prediction_System.gitf84f8d9..571c3f0 master -> master29660@DESKTOP-CAB6SQB MINGW64 /d/predict-system (master)
$