76

When I commit I get this error from Subversion:

bash-2.05b$ svn commit -m "testing subversion, still"
Adding         baz
svn: Commit failed (details follow):
svn: MKCOL of '/viper/!svn/wrk/6b9bcd38-b2fe-0310-95ff-9d1a44098866/sandboxes/ohammersmith/trunk/baz': 405 Method Not Allowed (http://svn.example.com)
1
  • 1
    When it happened to me it was because instead of doing a mkdir baz, I did a cp -pr ./foo/ ./baz --thereby getting the ./baz/.svn/ dir containing SVN info for the foo dir. To fix it, I just did rm -rf baz/.svn and then was able to svn add, svn ci ...
    – MarkHu
    Dec 21, 2012 at 9:34

3 Answers 3

110

This happens when you have added a directory that someone else has also added and already committed. The error message on a commit is really confusing, but if you do an svn up instead you'll see this message:

bash-2.05b$ svn up
svn: Failed to add directory 'baz': object of the same name already exists

To resolve the issue, remove your directory (or move it aside) and do an svn update to get the version on the server and re-do your changes.

As a general rule, be sure to do svn update since the error messages tend to be more helpful.

5
  • 8
    Sometimes the problem arises but an update is useless because oddly enough Subversion does not try to retrieve the directory from the repository; this is often the case when using Tortoise SVN. The solution is then to access to the repository itself, e.g. using the Tortoise SVN "Repo-browser", and to delete the directory. Then you should be able to add and commit your local data to the repository.
    – Pragmateek
    May 18, 2011 at 9:56
  • 3
    Pragmateek - that can be dangerous if you are not the only one working on files in that folder. The safest way is as Otto suggested. Move the local directory aside, update your local copy (or checkout a brand new copy if update doesn't work), then copy your folder over top (to get any changes). SVN will then pick up the changes and you won't lose all the work everyone else did to that folder since your last update.
    – DanCaveman
    Jun 21, 2013 at 16:24
  • How to fix it under MS Windows?
    – NoWar
    May 7, 2016 at 13:38
  • 2
    @Dimi SVN commands are the same on Linux and on Windows. Open a windows cmd, go to your repo and type svn up.
    – Winter
    Jun 29, 2017 at 14:53
  • Pragmateek / Dimi - Pragmateek's comment worked for me on Windows. I copied the folder i needed locally (unversioned). Then went into the repo browser and delete the folder directly from the SVN. I then updated, pasted the file back in a committed and it all was fixed. Thanks so much Pragmateek Jul 6, 2017 at 19:07
20

This happens when you have added a directory that someone else has also added and already committed.

This is something to indicate conflict but at Directories level (just to understand).

To resolve this, just do svn update before committing your changes

0

Sometimes this happens. Solution: When you create any new repository must add read.me file to create a default branch(trunk) so that it will find a proper path to push your stuff. If you create a repository and do not add read. me and if it is blank then upload a file like test.txt and take that uploaded file as latest update in your local folder and then try to push your code from that updated folder. This works for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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