简体   繁体   中英

How to make specific revision a HEAD in SVN?

I have a revision 58092, I want to make it HEAD revision. I have 4 commits in trunk folder after 58092 revision. I tried svn merge -r 58092:HEAD but I am getting error

svn: E205001: Try 'svn help merge' for more information
svn: E205001: Merge source required
  1. You are missing the SOURCE argument in the merge command. This is the signature of the command: merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH] merge [-c M[,N...] | -r N:M ...] SOURCE[@REV] [TARGET_WCPATH] .

  2. You don't want to apply rev 58092-HEAD to your working copy, you want to remove it. Therefore try -r HEAD:58092.

In summary I think this should work (assuming you are in the root of your branch.

svn merge -r HEAD:58092 .

Here is some more info on SOURCE :

 SOURCE specifies the branch from where the changes will be pulled, and
 TARGET_WCPATH specifies a working copy of the target branch to which
 the changes will be applied. Normally SOURCE and TARGET_WCPATH should
 each correspond to the root of a branch. (If you want to merge only a
 subtree, then the subtree path must be included in both SOURCE and
 TARGET_WCPATH; this is discouraged, to avoid subtree mergeinfo.)

 SOURCE is usually a URL. The optional '@REV' specifies both the peg
 revision of the URL and the latest revision that will be considered
 for merging; if REV is not specified, the HEAD revision is assumed. If
 SOURCE is a working copy path, the corresponding URL of the path is
 used, and the default value of 'REV' is the base revision (usually the
 revision last updated to).

 TARGET_WCPATH is a working copy path; if omitted, '.' is generally
 assumed. There are some special cases:

   - If SOURCE is a URL:

       - If the basename of the URL and the basename of '.' are the
         same, then the differences are applied to '.'. Otherwise,
         if a file with the same basename as that of the URL is found
         within '.', then the differences are applied to that file.
         In all other cases, the target defaults to '.'.

   - If SOURCE is a working copy path:

       - If the source is a file, then differences are applied to that
         file (useful for reverse-merging earlier changes). Otherwise,
         if the source is a directory, then the target defaults to '.'.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM