【发布时间】:2015-09-12 11:57:28
【问题描述】:
我创建了一个名为Exploratory Data Analysis/Course Project 1/ 的目录,其中包含household_power_consumption.txt 文件。我试图将它推送到我的 git repo 中,并收到关于 household_power_consumption.txt 大小的警告,所以我添加了一个 .gitignore 文件,其中包含以下行:
Exploratory\ Data\ Analysis/Course\ Project\ 1/household_power_consumption.txt
我尝试按照here、here 和here 发布的解决方案进行操作,但这些都不适合我。我总是收到同样的错误:
git push origin master
Counting objects: 31, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (28/28), done.
Writing objects: 100% (31/31), 20.48 MiB | 221.00 KiB/s, done.
Total 31 (delta 6), reused 0 (delta 0)
remote: error: GH001: Large files detected.
remote: error: Trace: 491a8219bf1d3de4fd08a8e3ea253faa
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File Exploratory Data Analysis/Course Project 1/household_power_consumption.txt is 126.80 MB; this exceeds GitHub's file size limit of 100.00 MB
To https://github.com/jd901215/DataScience_CourseraSpecialization.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/jd901215/DataScience_CourseraSpecialization.git'
这是我项目的本地目录树:
├── Exploratory Data Analysis
│ └── Course Project 1
│ └── household_power_consumption.txt
├── .git
│ ├── branches
│ ├── COMMIT_EDITMSG
│ ├── config
│ ├── description
│ ├── FETCH_HEAD
│ ├── HEAD
│ ├── hooks
│ │ ├── applypatch-msg.sample
│ │ ├── commit-msg.sample
│ │ ├── post-update.sample
│ │ ├── pre-applypatch.sample
│ │ ├── pre-commit.sample
│ │ ├── prepare-commit-msg.sample
│ │ ├── pre-push.sample
│ │ ├── pre-rebase.sample
│ │ └── update.sample
│ ├── index
│ ├── info
│ │ └── exclude
│ ├── logs
│ │ ├── HEAD
│ │ └── refs
│ │ ├── heads
│ │ │ └── master
│ │ └── remotes
│ │ └── origin
│ │ └── master
│ ├── objects
| | ├── (Bunch of SHA-1 checksums I guess )
│ │ ├── info
│ │ └── pack
│ ├── ORIG_HEAD
│ └── refs
│ ├── heads
│ │ └── master
│ ├── remotes
│ │ └── origin
│ │ └── master
│ └── tags
├── .gitignore
├── LICENSE
├── README.md
└── R programming
├── README.md
├── Week 1 Programming assignment
│ ├── complete7.R
│ ├── complete.R
│ ├── corr.R
│ ├── pollutantmean.R
│ ├── .RData
│ ├── .Rhistory
│ └── specdata
├── Week 2 Programming assignment
│ ├── cachematrix.R
│ └── README.md
└── Week 4 Programming assignment
├── best.R
├── hospital-data.csv
├── Hospital_Revised_Flatfiles.pdf
├── outcome-of-care-measures.csv
├── .Rhistory
└── rprog-doc-ProgAssignment3.pdf
抱歉,这篇文章很长,但我正在尝试提供必要的信息。提前致谢
【问题讨论】:
-
如果您删除 txt 文件并简单地提交新文件夹会发生什么?如果可行,您能否在该新文件夹中创建一个小文件并成功提交?
-
嗨@ShawnMehan!如果我在本地删除 .txt 我会得到同样的错误。
-
抱歉,您仍然收到有关已删除的 txt 文件大小的警告?
-
是的,先生!即使我使用命令 git rm -r --cached .
-
所以你应该恢复你的本地以匹配我认为的远程。在这一点上,你对那个更有信心,所以放下这些改变,让自己回到一个好的地方。