Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN: How to re-create a directory that's created but not committed yet

Here's a little SVN problem:

I create a directory locally:

$ svn mkdir output
A         output

I accidentally remove it:

rm -rf output

Now, how do I recreate it? I tried this:

$ svn mkdir output
svn: 'output' is already under version control

And this:

$ svn revert output
Reverted 'output'

But it's still not there.

UPDATE: People are suggesting that a simple mkdir output should have been enough after removing it. But in my SVN version that is not the case. It ignores the fact that there is an output/.svn directory that I also removed. Just mkdir output won't bring that one back, of course. So, somehow, SVN has to be involved in the recreation of that output directory. (I'm using SVN 1.4.6.)

like image 318
Frank Avatar asked Nov 16 '25 08:11

Frank


1 Answers

Remove it officially in SVN:

$  svn rm --force output
svn: 'output' does not exist

Then create it again:

$ svn mkdir output 
A         output

That output from svn remove above is a bit misleading. I thought the remove had failed, and it wouldn't change anything.

It's not the most intuitive approach here by SVN, but this way it works.

like image 126
Frank Avatar answered Nov 18 '25 03:11

Frank



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!