2

My colleague accidentally pushed some large size videos into our git repository.

  1. Does that make our git repo size large? even we removed videos did another push
  2. if so, how can we fix it to reduce the size when cloning our repository to a new PC?

i would appreciate any help, thanks!

Binsoi
  • 383
  • 5
  • 13
  • 2
    Look into [using git filter-branch](http://www.zyxware.com/articles/4027/how-to-delete-files-permanently-from-your-local-and-remote-git-repositories) to clean up the remote repository. But keep in mind this requires rewriting the remote history, which can be a pain to deal with. – Tim Biegeleisen Dec 14 '15 at 03:17

1 Answers1

5
  1. Yes, that means your repository will be large.
  2. You need to rewrite the history from the point where the videos where pushed. This only works good if your project was not published yet, because all people working with the repo will need to base their work on the newly revised history.
NEOatNHNG
  • 904
  • 6
  • 9
  • Thanks!, it looks like transferring it a new git repository would be more easy though we would lose all our commits. – Binsoi Dec 14 '15 at 03:28
  • 1
    @Binsoi: I wouldn't throw the whole commit history away, that would be throwing out the baby with the bathwater. Just rewrite the tree or if there is only one commit that introduced the large files then modify that commit and rebase the old branch on top of it. – NEOatNHNG Dec 14 '15 at 13:25
  • @NEOatNHNG: correct answer, except your link points to the filter-branch section of ProGit. I would rather suggest `git rebase --interactive`, which can achieve the same goal but it's simpler. – Luca Ceresoli Dec 15 '15 at 10:57