Reputation: 2337
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!
Upvotes: 2
Views: 1072
Reputation: 67137
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):
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.
Upvotes: 6