Member Avatar for Member #1122050

So this isn't necessarily a programming question but here it is. Also I'm not sure if this is the right area to be posting this. Couldn't find an area that matched my question

If I have a SVN Repository like /usr/data/svn/myproject And this repo directory has files and folders in it.

Then I type

sudo svnadmin create myproject

Will that automatically overwrite the previous directory or will it throw an error saying the repo already exists

I by mistake created my new directory and I am not sure if it overwrited an existing directory

Dani AI

Generated

Short answer: svnadmin create will not silently overwrite a non‑empty directory. It creates a new, empty Subversion repository (and will create the target folder if it does not exist), but if the target path already exists and is non‑empty the command fails with an error rather than replacing your files. (svnbook.red-bean.com)

Practical checks to see what happened (run on the machine that holds the path shown in the original post): list the directory and look for the Subversion repository layout (conf, db, hooks, locks, format, README.txt), test for the format file, and ask the repository what its youngest revision is. If those repo items are missing, no repository was created; if present, the repo was created (new repos report revision 0). Example commands:

ls -la /usr/data/svn/myproject
test -f /usr/data/svn/myproject/format && echo "format present"
svnlook youngest /usr/data/svn/myproject

These checks are the usual way to identify repository state. (studylib.net)

If a repository exists and you want to be safe, make a hotcopy and run a verify before doing anything else that writes to the path. Also fix ownership/permissions if the command was run with elevated rights. Example:

svnadmin hotcopy /usr/data/svn/myproject /tmp/myproject-hotcopy
svnadmin verify /tmp/myproject-hotcopy
chown -R svnuser:svngroup /usr/data/svn/myproject

Back up or restore from existing backups/snapshots if files appear to be missing; manual edits inside a repository tree should be avoided. (tortoisesvn.net)

This complements the earlier thread notes from and by giving exact commands to confirm whether a repository was created and safe next steps for backing up or recovering the data discussed in the original question by .

Recommended Answers

All 2 Replies

Unfortunately I don't know the answer to your question but I'd like to make two points.

Firstly, I've gone ahead and tagged this thread with SVN. Secondly, why not switch to git? I finally took the plunge and I couldn't be happier. That being said, I use an IDE with both svn and git built into the GUI.

Member Avatar for Member #120589

Check the file creation/modified dates?
I couldn't find the info either (also use git), but start a new project and test for yourself, if you can't work it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.