Skip to main content.
September 16th, 2007

svnleave - a Tool for Cleaning-up and SVN Directory

When you need to copy a project that resides in a Subversion repository to another location or send a piece of the source code by email, you need to clean the all .svn or _svn files from its directory structure.

I know an easy way to do this by the TortoiseSVN GUI client for Windows:

SVN export

This works pretty well but sometime you need more simple solution: removing all .svn directories from given project. I didn’t found any useful tool for this so I wrote one: svnleave.

My favourite programming language for writing such small programs is C#. It is highly productive, user friendly, have very good development environment and runs on any Windows machine (I mostly use Windows as desktop).

Here is the source code:

A compiled version svnleave for .NET Framework 2.0 is available for download here: svnleave.exe.

Posted by nakov in .net, blog

This entry was posted on Sunday, September 16th, 2007 at 1:04 pm and is filed under .net, blog. You can follow any responses to this entry through the comments RSS 2.0 feed. Both comments and pings are currently closed.

5 Responses to “svnleave - a Tool for Cleaning-up and SVN Directory”

  1. 0xdeadc0de says:

    Това горе прилича на трепане на муха с топ.

    Ползване на WinRAR за архивиране на всичко без .svn:

    Файла се изпълнява от директорията, чийто архив искаме да създадем (заедно със всички под-директории)

    –8 xclude.txt
    echo archive.bat >> xclude.txt
    dir /a /b /s .svn* >> xclude.txt

    c:\progra~1\winrar\rar a -m0 -r -x@xclude.txt backup.rar *
    –8 filelist.txt

    for /F %%x in (filelist.txt) do (
    rd /s /q %%x
    )

    del filelist.txt
    –8

  2. 0xdeadc0de says:

    Що за некултурен escape na < ?

    повтарян, като си го escape-вам сам:

    –[archive.bat]–
    @echo off
    echo xclude.txt > xclude.txt
    echo archive.bat >> xclude.txt
    dir /a /b /s .svn* >> xclude.txt
    dir /a /b /s vssver.scc >> xclude.txt

    c:\progra~1\winrar\rar a -m0 -r -x@xclude.txt backup.rar *
    —–

    –[delete.bat]–
    @echo off
    dir /a /b /s .svn* > filelist.txt

    for /F %%x in (filelist.txt) do (
    rd /s /q %%x
    )

    del filelist.txt
    —–

  3. nakov says:

    Thank you ofr the interesting comment, 0xdeadc0de. It is nice to use shell scripts in Windows, eventhough I hate the syntax it uses.

    Please next time post in English because this blog is in English only.

  4. jmut says:

    Can you give example of not able to use export but rather this…executable of yours?
    Kind of useless I think

  5. nakov says:

    Can you give example of not able to use export but rather this…executable of yours?
    Kind of useless I think.

    You can receive by email some code that contains folders with .svn files. This tool is the easiest way to cleanup the code before importing it in Eclipse or Visual Studio.