Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to clear all all previous revisions and leave only the current revision.

Is there a way to do this?

I don't find a possible command to do this:

[secret@vps303 ~]# svnadmin --help
general usage: svnadmin SUBCOMMAND REPOS_PATH  [ARGS & OPTIONS ...]
Type 'svnadmin help <subcommand>' for help on a specific subcommand.
Type 'svnadmin --version' to see the program version and FS modules.

Available subcommands:
   help (?, h)


Seems the only solution is to export then import, but will the access permission settings be also exported when we run svn export ?

share|improve this question
Why don't you want to checkout current revision and then create new repository for it? – lexsys Jun 5 '10 at 8:13
That would be better, but is it possible with zendstudio? I don't find a menu to create a repository with zendstudio. – apache Jun 5 '10 at 8:16

1 Answer 1

The answer is indeed to

svnadmin dump -r<revisionnumber> /old/repo/path > repo.dmp
svnadmin create /new/repo/path
svnadmin load  /new/repo/path <  repo.dmp

Do not use svn export, you might loss some handy svn:externals, svn:ignore's, svn:executable and the like. Older revisions & logging OK, but those you normally want to keep :)

Possible auth/access/hook/other configuration you can usually copy by copying the ./conf & ./hooks directories from the old repository to the new one. As long as there are no hardcoded paths in it those should work instantly. After copying those dirs do compare the file premissions of your old & new repo.

Use the svnadmin bin on the svn-server, you cannot do this with an svn client.

share|improve this answer
I don't exactly get the difference between svn export and svnadmin dump, it seems to me the only difference is that svn export will create recursive subdirectories if necessary, while svnadmin dump will store all the information in a single file? – apache Jun 7 '10 at 12:53
With export you will LOSE ALL SVN SETTINGS, with dump you will lose only the specific changes per revision & the revisionnumbers (up to the number you give, for instance, you could keep revisions 123 to 128, which would be 1 to 5 on import), which you can load directly into another repository. – Wrikken Jun 7 '10 at 13:15
I just made a test, with dump the settings in conf/passwd and conf/svnserve.conf aren't dumped,say,they're also LOST, right? – apache Jun 7 '10 at 13:22
OK, authorisation/server settings are not preserved, but file settings in svn are. Then again, if you never have done any propsetting/ignoring of files you wouldn't see a difference. Most of my projects are so modular I'd hate to have svn:external's forgotten, let alone setting back all svn:executable's. – Wrikken Jun 7 '10 at 13:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.