~/D/s/b/h_adv_ML (master±) ▶︎︎ git ls-files --error-unmatch *.csv
test_rmse.csv
train_rmse.csv
error: pathspec 'genome-scores.csv' did not match any file(s) known to git.
error: pathspec 'genome-tags.csv' did not match any file(s) known to git.
error: pathspec 'links.csv' did not match any file(s) known to git.
error: pathspec 'movies.csv' did not match any file(s) known to git.
error: pathspec 'ratings.csv' did not match any file(s) known to git.
error: pathspec 'tags.csv' did not match any file(s) known to git.
Did you forget to 'git add'?
~/D/s/b/h_adv_ML (master±) ▶︎︎ git commit -m " clean3"
[master b31185a] clean3
2 files changed, 1 insertion(+), 465566 deletions(-)
delete mode 100644 tags.csv
~/D/s/b/h_adv_ML (master) ▶︎︎ git push origin master
Counting objects: 36, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (35/35), done.
Writing objects: 100% (36/36), 192.26 MiB | 2.17 MiB/s, done.
Total 36 (delta 12), reused 0 (delta 0)
remote: Resolving deltas: 100% (12/12), completed with 1 local object.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.
remote: error: Trace: 70338ad9481eef83938b427ed955775e
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File genome-scores.csv is 308.56 MB; this exceeds GitHub's file size limit of 100.00 MB
remote: error: File ratings.csv is 508.73 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/<...>/h_adv_ML.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/<...>/h_adv_ML.git'
当他们不追踪时,它试图推动它们!我在这里想念什么?我不确定为什么它在未跟踪时会尝试推动"基因组得分"one_answers" ratings.csv"。
$ git status
On branch master
Your branch is ahead of 'origin/master' by 8 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
$ tree
.
├── README.md
├── README.txt
├── check.py
├── check_old.py
├── code.py
├── genome-scores.csv
├── genome-tags.csv
├── links.csv
├── movies.csv
├── old_code.py
├── ratings.csv
├── read_py.py
├── tags.csv
├── test_rmse.csv
└── train_rmse.csv
我已经发表了几个评论,但是我想我想出了一个相当基本的解决方案 - 自上次以来,您需要"挤压"提交推。
-
确定遥控器上的最后一个提交。您可以使用
git log --oneline
进行此操作,并在其旁边查找origin/master
的提交。然后复制提交的ID,即在行开头的〜7个字符的十六进制字符串。 -
git reset COMMIT
(例如git reset abcdef0
(将取出所有提交并"解开"它们。这意味着自该提交(包括该提交(以来所做的所有更改都将被从git中取出,但仍保留在您的文件系统中。 -
确定要保留并推荐的重置承诺中所做的任何更改。它应该告诉您上一个命令后的"重置后未分段更改"。
-
您应该能够将承诺的更改推向GitHub存储库。
稍大的编程版本:
# get sha1 revision of origin/master and reset to that
git reset $(git rev-parse origin/master)
# git add via patch, so you can moderate what you add
git add -p
git commit
git push