0
~/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'

当他们没有被跟踪时,它会试图推动他们!我在这里想念什么?我不确定为什么它在未跟踪时尝试推送“genome-scores.csv”和“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
4

1 回答 1

2

我已经发表了一些评论,但我想我已经提出了一个相当基本的解决方案 - 自上次推送以来,您需要“压缩”提交。

  1. 确定远程上的最后一次提交。您可以使用它来执行此操作并在它旁边git log --oneline查找提交。origin/master然后复制提交的 ID,即行首约 7 个字符的十六进制字符串。

  2. git reset COMMIT(例如git reset abcdef0)将取出所有提交并“取消暂存”它们。这意味着自该提交(包括该提交)以来所做的所有更改都将从 Git 中取出,但保留在您的文件系统中。

  3. 确定您要保留的重置提交中所做的任何更改并重新提交它们。它应该在上一个命令之后告诉您“重置后未暂存的更改”。

  4. 您应该能够将提交的更改推送到 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
于 2018-02-21T17:49:47.550 回答