2

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!

user1051849
  • 2,205
  • 5
  • 24
  • 42
  • Dont get the question, are you asking how to find that particular file or asking how to exclude a file from versioning? – Kristian Hildebrandt Feb 06 '12 at 17:45
  • in short, git push heroku keeps trying to push a big file that isn't there - in the directory or in git - anymore. I want it to stop doing that. confirming the file is the one i am thinking of, would simply help diagnose the problem. – user1051849 Feb 06 '12 at 17:59

1 Answers1

6

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.

Community
  • 1
  • 1
eckes
  • 56,506
  • 25
  • 151
  • 189