how to restore a locally deleted folder?

后端 未结 5 1939
温柔的废话
温柔的废话 2020-12-24 07:27

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

相关标签:
5条回答
  • 2020-12-24 07:55
    svn status|grep ^D|^Ct -c9-|xargs -n1 svn revert
    
    0 讨论(0)
  • 2020-12-24 07:56

    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

    0 讨论(0)
  • 2020-12-24 07:59

    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.
    
    0 讨论(0)
  • 2020-12-24 08:05

    I use for accidentally deleted folder command

    SVN UPDATE

    on parent folder

    0 讨论(0)
  • 2020-12-24 08:12

    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
    
    0 讨论(0)
提交回复
热议问题