Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete an SVN project from SVN repository

Tags:

svn

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.

like image 579
pjain Avatar asked Nov 09 '11 11:11

pjain


People also ask

How do I get rid of TortoiseSVN?

How do I uninstall TortoiseSVN? Simply uninstall from Add/Remove Programs in the Windows control panel. This does not affect your repositories or working copies at all.

Can we delete .svn folder?

Just export the WC to itself. (Essentially this deletes all the . svn folders... which you could do manually if you want also).

How do I delete a working copy in svn?

If you have a working copy which you no longer need, how do you get rid of it cleanly? Easy - just delete it in Windows Explorer! Working copies are private local entities, and they are self-contained. Deleting a working copy in Windows Explorer does not affect the data in the repository at all.


2 Answers

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 
like image 175
user237419 Avatar answered Sep 19 '22 14:09

user237419


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

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

    • /skunkworks "Project" due to layout
      • /tags
      • /branches
      • /trunk
    • /app1 "Project" due to layout
      • /tags
      • /branches
      • /trunk
    • /fooproject "Project" due to layout
      • /tags
      • /branches
      • /trunk
    • /regulardir <-- Not a "Project"
      • /subdir
  • http://svn.server.local/svn/myrepo2

    • /app2"Project" due to layout
      • /tags
      • /branches
      • /trunk

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.

like image 36
Andrew T Finnell Avatar answered Sep 22 '22 14:09

Andrew T Finnell