# migrating from svn: How to clean up history?

3 messages from 2011-12-13 to 2011-12-16. Participants: Hartmut Goebel, Jakub Narebski, Thomas Ferris Nicolaisen.
Thread: https://gitlist.dev/t/29148

## Hartmut Goebel, 2011-12-13 14:53

Subject: migrating from svn: How to clean up history?
Message-ID: <4EE766D5.5040702@goebel-consult.de>
URL: https://gitlist.dev/e/4EE766D5.5040702%40goebel-consult.de

```
Hello,

I'm one of the developers of www.pyinstaller.org, a tool for 
bundling/packagin Python scripts and al required modules into a single 
executable for easy distribution. We are in the process of migrating 
from Subversion to git.

Our SVN-Repo contains some stuff we do not want or do not need in the 
git repo. How can we clean this up?

1) Useless commits e.g. tagging -> I want to remove these
2) copy or move mistakes -> I want to "correct" the copy

Example for 1): This occurs e.g. if this is done

svn cp trunk tags/v0.1 -m 'release v0.1' <<<--- this on in not needed
svn rm tags/v0.1 -m 'release v0.1'
svn cp trunk tags/v0.1 -m 'release v0.1'

In this case I want to completely eliminate the first commit.

Example for 2): This occurs e.g. if this is done

svn cp trunk tags/v0.1 -m 'release v0.1'
svn cp trunk tags/v0.1 -m 'release v0.1' <<-- actually copies to 
tags/v0.1/trunk

In this case I want to change eliminate the first commit (this is he 
same as case 1) and rewrite commit 2 to rewrite the path.

I already did some experiments with `git filter-branch` without success. 
(I manage renaming the tags, though.)

Any hints how to to this clean-up?

-- 
Schönen Gruß - Regards
Hartmut Goebel
Dipl.-Informatiker (univ.), CISSP, CSSLP

Goebel Consult
Spezialist für IT-Sicherheit in komplexen Umgebungen
http://www.goebel-consult.de

Monatliche Kolumne: http://www.cissp-gefluester.de/
Goebel Consult ist Mitglied bei http://www.7-it.de

```

## Jakub Narebski, 2011-12-13 15:12

Subject: Re: migrating from svn: How to clean up history?
Message-ID: <m362hkh5em.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m362hkh5em.fsf%40localhost.localdomain
In-Reply-To: <4EE766D5.5040702@goebel-consult.de>

```
Hartmut Goebel <h.goebel@goebel-consult.de> writes:

> I'm one of the developers of www.pyinstaller.org, a tool for
> bundling/packagin Python scripts and al required modules into a single
> executable for easy distribution. We are in the process of migrating
> from Subversion to git.
> 
> Our SVN-Repo contains some stuff we do not want or do not need in the
> git repo. How can we clean this up?
> 
> 1) Useless commits e.g. tagging -> I want to remove these
> 2) copy or move mistakes -> I want to "correct" the copy
[...]

> Any hints how to to this clean-up?

You can try "gitsvnparse" command from 'reposurgeon' tool to
automatically correct some conversion mistakes, and use this tool to
do further fixes

  http://www.catb.org/esr/dvcs-migration-guide.html
  http://www.catb.org/~esr/reposurgeon/

HTH
-- 
Jakub Narebski

```

## Thomas Ferris Nicolaisen, 2011-12-16 23:11

Subject: Re: migrating from svn: How to clean up history?
Message-ID: <CAEcj5uWVUZ1BiGN3Aj=i9-tWo-vmBPcGyQzq8vGy-qsMpZu9Ug@mail.gmail.com>
URL: https://gitlist.dev/e/CAEcj5uWVUZ1BiGN3Aj%3Di9-tWo-vmBPcGyQzq8vGy-qsMpZu9Ug%40mail.gmail.com
In-Reply-To: <4EE766D5.5040702@goebel-consult.de>

```
> I already did some experiments with `git filter-branch` without success. (I manage renaming the tags, though.)
>
> Any hints how to to this clean-up?

There are some examples of how to use filter-branch to remove empty
commits, and some other handy tips on this page:

http://thomasrast.ch/git/git-svn-conversion.html

```
