0

I was trying to delete a file in a github repo that belongs to an old commit, specifically the 2nd one since the repo was created. Then someone tried to fix it and deleted the file in its workspace and pushed the change...

It is a 500 mb rar file that someone thought it was a good idea to push in 2012 and now we have the need of get rid of it.

I have tried

But any of these worked for me. It seems to be a .pack file holding it.

The question is: can I really delete the file? Otherwise, are there any options to set up a new repo without loosing commit history?

Thanks in advance.

Community
  • 1
  • 1
chelazo
  • 43
  • 8
  • Please add details about why you think it doesn't work, in order to help you... – CharlesB Sep 03 '14 at 13:26
  • The file is part of *every* commit that is a descendent of the one that added the file. To purge the file entirely, you need to remove it from *all* of those commits. – chepner Sep 03 '14 at 13:29
  • You need to look at [`git filter-branch`](http://git-scm.com/docs/git-filter-branch#_examples). The second example in the link provided is what you want. You may want to look at GitHub's example too: https://help.github.com/articles/remove-sensitive-data. It also mentions using BFG to help do the work too, which may be easier for you to accomplish. Be forewarned, this will rewrite your history. There's no getting around that to remove the file completely from the repository. – John Szakmeister Sep 03 '14 at 14:06

1 Answers1

0

As jszakmeister mentioned in a comment, the solution was in the sensitive-data help article in github. It suggest the use the BFG Repo-Cleaner for such an issue.

I used the jar to delete all the files bigger than 10M, as BFG home page states.

Thanks!

Community
  • 1
  • 1
chelazo
  • 43
  • 8