Results 1 to 4 of 4

Thread: svn update for single file

  1. #1

    svn update for single file

    Hello -- Is it possible to use update to get a single file version from a repository and ignore other files? Would the command go something like: svn update -r 1951 filename.php

    Please let me know if this will work and if it doesn't, how I might handle this need to rollback. Thank you!

  2. #2
    Senior Member
    Join Date
    Feb 2008
    Location
    Glasgow, Scotland
    Posts
    1,288
    Hi kktaus

    Yes it is, assuming that your checkout isn't "sparse", i.e. you didn't specify a depth when you did the initial checkout. If you've done a sparse checkout, such that you have the parent directory but no files, then you'll need to "svn update" the parent directory while specifying a depth. Parameters for depth are only as fine-grained as "files", so you'll end up with all the files in the directory.

    Cheers
    John
    John Niven

  3. #3

    re: svn update for single file

    Quote Originally Posted by JNiven
    Hi kktaus

    Yes it is, assuming that your checkout isn't "sparse", i.e. you didn't specify a depth when you did the initial checkout. If you've done a sparse checkout, such that you have the parent directory but no files, then you'll need to "svn update" the parent directory while specifying a depth. Parameters for depth are only as fine-grained as "files", so you'll end up with all the files in the directory.

    Cheers
    John
    The update of a single file worked for us. Thanks!

    Now when I try to commit that file svn returns an error message saying that it is out of date. Any advice on how to proceed?

    -Kathleen

  4. #4
    assuming that you are committing only this file, the reason could be that you realy have an older version ( -r 1951 filename.php) in your working copy. Commit will need you to update your file to latest revision.
    Now...
    If you use svn update on this file you will get a conflict message something like this:
    Code:
    Conflict discovered in filename.php'.
    Select: (p) postpone, (df) diff-full, (e) edit,
            (mc) mine-conflict, (tc) theirs-conflict,
            (s) show all options:
    You need to resolve this and only after that you can proceed.

    Sachidanand

Similar Threads

  1. update for single non-local folder
    By pospiech in forum Windows Servers
    Replies: 5
    Last Post: 11-13-2008, 04:47 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •