---
title: "Removing large files when using git-svn to migrate repositories"
date: 2016-11-29
author: "Jonathan Desrosiers"
pubDate: "Tue, 29 Nov 2016 16:09:18 GMT"
link: "https://jonathandesrosiers.com/2016/11/removing-large-files-when-using-git-svn-to-migrate-repositories/"
urlPrev: "https://jonathandesrosiers.com/2016/09/wordcamp-rhode-island-2016-slides.md"
urlNext: "https://jonathandesrosiers.com/2017/02/empty-stable-column-on-translate-wordpress-org.md"
---

# Removing large files when using git-svn to migrate repositories

Today I was migrating SVN repositories over to GIT using [BU’s svn2git utility](https://github.com/bu-ist/svn2git). I came across one repository that [GitHub](https://github.com) would not allow me to push because it contained a file that was over 100MB.

After some investigation, I realized that the file it specified was only 25KB. However, at some point in its history it was over 100MB, Because I was pushing the entire commit history for that repository, it was rejecting everything.

The solution is to remove the file entirely from the repository’s history. It took some trial and error for me to find something that worked for me because most snippets relied on history already existing in the origin repository. Here is what worked for me:

`git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch path_to_file" HEAD`

Hope this helps someone!

### Like this:

Like Loading…

<a class="sd-link-color"></a>