Locally deleting a file followed by svn update restores the local copy of that file. However this does not seem to apply to folders. Is there any way to make it work for fol
svn status|grep ^D|^Ct -c9-|xargs -n1 svn revert
use svn revert (-R) foldername
to bring it back. you have deleted it using svn rm
and svn up
will not recreate it for you, because it is still marked as deleted
I ran into this problem today with svn 1.5.6.
svn up --force the_dir_path
fixed it for me.
To recreate:
$ svn up
Updated to revision X.
$ rm -rf the_dir_path
$ svn up
D the_dir_path
Updated to revision X.
$ svn up
Updated to revision X.
$ svn up --force the_dir_path
A ....
A ....
Updated to revision X.
I use for accidentally deleted folder command
SVN UPDATE
on parent folder
You probably want to use the svn revert command rather than going through the process of deleting items and then updating to revert them. Use the -R switch to recursively revert files/directories.
svn help info for revert is as follows
revert: Restore pristine working copy file (undo most local edits).
usage: revert PATH...
Note: this subcommand does not require network access, and resolves
any conflicted states. However, it does not restore removed directories.
Valid options:
--targets ARG : pass contents of file ARG as additional args
-R [--recursive] : descend recursively, same as --depth=infinity
--depth ARG : limit operation by depth ARG ('empty', 'files',
'immediates', or 'infinity')
-q [--quiet] : print nothing, or only summary information
--changelist ARG : operate only on members of changelist ARG
[aliases: --cl]
Global options:
--username ARG : specify a username ARG
--password ARG : specify a password ARG
--no-auth-cache : do not cache authentication tokens
--non-interactive : do no interactive prompting
--trust-server-cert : accept unknown SSL server certificates without
prompting (but only with '--non-interactive')
--config-dir ARG : read user configuration files from directory ARG
--config-option ARG : set user configuration option in the format:
FILE:SECTION:OPTION=[VALUE]
For example:
servers:global:http-library=serf