31

Can anyone please suggest me how to delete complete SVN project from SVN repository (svn repository is in linux). I found "svn delete", but don't think it does the same. It only helps in removing files or sub-folders but not the entire project.

2
  • 3
    Do you mean 'delete' as in 'remove from the head of the repository but leave history' or 'obliterate' as in 'remove the project and all history from the repository'? Commented Nov 9, 2011 at 11:33
  • I believe he was about to 'obliterate' a project (sub-tree) from a repository. Commented Jan 30, 2013 at 12:24

9 Answers 9

53

this answer can be confusing

do read the comments attached to this post and make sure this is what you are after

'svn delete' works against repository content, not against the repository itself. for doing repository maintenance (like completely deleting one) you should use svnadmin. However, there's a reason why svnadmin doesn't have a 'delete' subcommand. You can just

rm -rf $REPOS_PATH 

on the svn server,

where $REPOS_PATH is the path you used to create your repository with

svnadmin create $REPOS_PATH 
Sign up to request clarification or add additional context in comments.

3 Comments

Uh. I'd call that deleting a repository, not project.
I agree with @MichaelKrelin-hacker because your answer can be confusing for newbies and someone could remove whole repository while his intention was just to remove a project within.
It depends on how you organize everything. If you create a new repository for each project, then you can go ahead. Otherwise, make a backup first before you delete too much.
13

I too felt like the accepted answer was a bit misleading as it could lead to a user inadvertently deleting multiple Projects. It is not accurate to state that the words Repository, Project and Directory are ambiguous within the context of SVN. They have specific meanings, even if the system itself doesn't enforce those meanings. The community and more importantly the SVN Clients have an agreed upon understanding of these terms which allow them to Tag, Branch and Merge.

Ideally this will help clear any confusion. As someone that has had to go from git to svn for a few projects, it can be frustrating until you learn that SVN branching and SVN projects are really talking about folder structures.

SVN Terminology

Repository

The database of commits and history for your folders and files. A repository can contain multiple 'projects' or no projects.

Project

A specific SVN folder structure which enables SVN tools to perform tagging, merging and branching. SVN does not inherently support branching. Branching was added later and is a result of a special folder structure as follows:

  • /project
    • /tags
    • /branches
    • /trunk

Note: Remember, an SVN 'Project' is a term used to define a specific folder strcuture within a Repository

Projects in a Repository

Repository Layout

As a repository is just a database of the files and directory commits, it can host multiple projects. When discussing Repositories and Projects be sure the correct term is being used.

Removing a Repository could mean removing multiple Projects!

Local SVN Directory (.svn directory at root)

When using a URL commits occur automatically.

  • svn co http://svn.server.local/svn/myrepo
  • cd myrepo

  • Remove a Project: svn rm skunkworks + svn commit

  • Remove a Directory: svn rm regulardir/subdir + svn commit
  • Remove a Project (Without Checking Out): svn rm http://svn.server.local/svn/myrepo/app1
  • Remove a Directory (Without Checking Out): svn rm http://svn.server.local/svn/myrepo/regulardir

Because an SVN Project is really a specific directory structure, removing a project is the same as removing a directory.

SVN Repository Management

There are several SVN servers available to host your repositories. The management of repositories themselves are typically done through the admin consoles of the servers. For example, Visual SVN allows you to create Repositories (databases), directories and Projects. But you cannot remove files, manage commits, rename folders, etc. from within the server console as those are SVN specific tasks. The SVN server typically manages the creation of a repository. Once a repository has been created and you have a new URL, the rest of your work is done through the svn command.

1 Comment

Could you add to your answer, how to "obliterate" a "project"? In other words, using the definition about, I would like to delete a "project" and recover the 50Gb it used without getting obliterating the repository (and without making a temporary copy of the repository as one answer described). Is that possible?
11

"Obliberating" contents from a svn repository, i.e. wiping this contents from the disc, can be done as described in this article http://www.limilabs.com/blog/how-to-permanently-remove-svn-folder

It requires access to the server side svn repository, thus you must have some admin privileges.

It works by (a) dumping the repository content into a file, (b) excluding some contents and (c) wiping and re-creating the plain repository again and eventually by (d) loading the filtered repository contents:

svnadmin dump "path/to/svnrepo" > svnrepo.txt // (a) svndumpfilter exclude "my/folder" < svnrepo.txt > filtered.txt // (b) rm -rf "path/to/svnrepo" && svnadmin create "path/to/svnrepo" // (c) svnadmin load "path/to/svnrepo" < filtered.txt // (d) 

The repository counter is unchanged by this operations. However, your repository is now "missing" all those revision numbers used to create that contents you removed in step (b).

Subversion 1.7.5 appears to handle this "missing" revisions pretty well. Using "svn ls -r $missing" for example, reports the very same as "svn ls -r $(( missing - 1))".

Contrary to this, my (pretty old) VIEWVC reports "no contents" when querying a "missing" revision.

4 Comments

the page with the article is not available anymore
@bahrep - limilabs.com/blog/how-to-permanently-remove-svn-folder works for me pretty well.
Can this be done some other way that does not require having to copy the entire repository?
@Les - not to my knowledge.
9

In the case where you simply want to delete a project from the head revision, so that it no longer shows up in your repo when you run svn list file:///path/to/repo/ just run:

svn delete file:///path/to/repo/project 

However, if you need to delete all record of it in the repo, use another method.

Comments

5

There's no concept of "project" in svn. So, feel free to delete whatever you think belongs to the project.

Comments

2

It's easy to believe that deleting the whole Subversion repository requires "informing" Subversion that you're going to delete the repository. But Subversion only cares about managing a repository once it's created, not whether the repository exists or not ( if that makes sense ). It goes like this: the Subversion tools and commands are not adversely affected by just deleting your repository directory with the regular operating system utilities (like rm -R). A repository directory is not the same thing as an installed program directory, where deleting a program without uninstalling it might leave behind erratic config files or other dependencies. A repository is 100% self-contained in its directory, and deleting it is harmless (besides losing your project history). You just clean the slate to create a new Subversion repository and import your next project.

Comments

1

Disposing of a Working Copy

Subversion doesn't track either the state or the existence of working copies on the server, so there's no server overhead to keeping working copies around. Likewise, there's no need to let the server know that you're going to delete a working copy.

If you're likely to use a working copy again, there's nothing wrong with just leaving it on disk until you're ready to use it again, at which point all it takes is an svn update to bring it up to date and ready for use.

However, if you're definitely not going to use a working copy again, you can safely delete the entire thing using whatever directory removal capabilities your operating system offers. We recommend that before you do so you run svn status and review any files listed in its output that are prefixed with a ? to make certain that they're not of importance.

from: http://svnbook.red-bean.com/en/1.7/svn.tour.cleanup.html

1 Comment

It's not a great idea to copy-paste from the documentation. Especially when the copied content does not answer the question.
-1

Go to Eclipse, Click on Window from Menu bar then "Open Perspective -> other -> SVN Repository Exploring -> Click OK"

Now, after performing "Click OK" you need to go to truck (or place where your project is saved in SVN) then select project(which you want to Delete) then right click -> Delete.

This Will Delete project from subversion.

Comments

-2

The correct sentence is: svnadmin deltify $PATH. do not forghet to delet the project or repository from the file svn-acl (if you use it). if you simply delete the folder of repository you may corrupt the svn directory depending on how your svn is configured in your environment.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.