git push heroku - 停止heroku推/上传海量文件 [英] git push heroku - stop heroku pushing/uploading massive file
问题描述
意外地把一个非常大的文件放在我的工作目录中没有被.gitignore排除,我提交了我的修改,推到github,然后做了一个git推动heroku进行生产。
当我看到它试图将100MB的数据推到heroku时,我杀死了这个进程。
我自从做了
git rm filename.extension
后跟
git add。
,一个新的提交和git推。但是当我到达 git push heroku
时,它坚持继续推送这个不可能的大数据文件。
如何能我检查有问题的文件是什么,以及如何让git / heroku忘记它曾经存在过,所以git push heroku可以重新开始工作......?
谢谢!
如果您执行了 git rm large.file
引入 large.file
仍然存在于您的回购的历史中。
为了让git忘记提交,您需要将其从回购的历史记录中删除。这可以使用 git rebase
完成,如这些问题的答案中所述(例如):
如何从Git存储库中删除选定的提交日志条目?从历史中,您可以 git push -f github
然后
$ b $
注意
Having accidentally put a pretty large file which was not excluded by .gitignore in my working directory i committed my changes, pushed up to github then did a git push heroku up to production.
when i saw it was trying to push 100s of MB of data up to heroku, i killed the process.
I have since done a
git rm filename.extension
followed by
git add .
, a new commit and git push. But when i get to git push heroku
it insists on continuing to push this impossibly large data file.
how can i check what the offending file is, and how can i make git/heroku forget it was ever there so git push heroku can start working again...?
Thanks!
If you did a git rm large.file
, the commit introducing the large.file
is still in the history of your repo.
To make git forget about the commit, you'll need to remove it from your repo's history. This could be done using git rebase
as described in the answers to these questions (for example):
- How do you remove a specific revision in the git history?
- How to remove selected commit log entries from a Git repository while keeping their changes?
After you removed the commit from the history, you could git push -f github
and then git push -f heroku
.
Note that git push -f
could cause problems if someone fetched the state of your github repo since your last push. See chapter The Perils of Rebasing in the progit book for an explanation why.
这篇关于git push heroku - 停止heroku推/上传海量文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!