Announcement

Collapse
No announcement yet.

svn update for single file

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      re: svn update for single file

      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

      Comment


      • #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

        Comment

        Working...
        X