How do you move a file?

380

Solution 1

Subversion has native support for moving files.

svn move SOURCE DESTINATION

See the online help (svn help move) for more information.

Solution 2

Check out section 5.14.2. Moving files and folders (or check out "move" in the Index of the help) of the TortoiseSVN help. You do a move via right-dragging. It also mentions that you need to commit from the parent folder to make it "one" revision. This works for doing the change in a working copy.

(Note that the SVN items in the following image will only show up if the destination folder has already been added to the repository.)

tortoise move menu

You can also do the move via the Repo Browser (section 5.23. The Repository Browser of the help).

Solution 3

With TortoiseSVN I just move the file on disk.

When I come to commit my changes I select the missing file and the new one and select "Repair move" from the right click menu:

enter image description here

This means I can let my IDE move round files and use it refactoring tools without losing history.

Solution 4

In TortoiseSVN right click somewhere and go TortoiseSVN > Repo Browser open the repository.

All you then have to do is drag and drop the file from one folder to the where you want it. It'll ask you to add a commit message and it defaults it to "Moved file/folder remotely"

Solution 5

Using TortoiseSVN I just right-click and drag the folder from one location to another. When you release the right-click you'll have the option to "SVN Move Version File." However, I believe that SVN doesn't do anything "fancy" there, but simply deletes the file in the previous location and Adds it to the new location.

Share:
380

Related videos on Youtube

elife_iPhone
Author by

elife_iPhone

Updated on December 05, 2020

Comments

  • elife_iPhone
    elife_iPhone over 3 years

    When I use this:

    - (void)mapView:(MKMapView *)myMapView annotationView:(MKAnnotationView *)view 
            calloutAccessoryControlTapped:(UIControl *)control
    {
        NSLog(@"SelectedAnnotations is %@", myMapView.selectedAnnotations);
    }
    

    It Displays this in the log.

    "<Annotation: 0x586cdb0>"
    

    Now this is a weird question, but how do I get the info from this Annotation? I have lost my mind.

    This is what is in the annotation.

    myAnnotation = [[Annotation alloc] init];
    myAnnotation.dealName=[NSString stringWithFormat:@"%@",[tempValue objectForKey:@"name"]];
    myAnnotation.subName=[NSString stringWithFormat:@"Price: $%@",[tempValue objectForKey:@"price"]];
    myAnnotation.latitude = [NSNumber numberWithDouble:[[tempValue objectForKey:@"dealLatitude"] doubleValue]];
    myAnnotation.longitude = [NSNumber numberWithDouble:[[tempValue objectForKey:@"dealLongitude"] doubleValue]];
    myAnnotation.dealId = [NSNumber numberWithInt:[ [tempValue objectForKey:@"dId"] intValue ]];
    

    Thanks for your help.

  • Joe Phillips
    Joe Phillips almost 13 years
    When I highlighted all my files, right-dragged, the regular windows explorer menu came up. It let me select "move" but it wasn't an SVN option so I'm not sure anything even happened. When I checked to see if there were modifications, it said 300 files were deleted and 300 were non-versioned. This doesn't seem like it worked correctly. I'm afraid to commit it without knowing if this is the way it's supposed to work or not
  • Joe Phillips
    Joe Phillips almost 13 years
    I just realized it probably didn't work because I hadn't added/committed the new directory yet
  • DarrenMB
    DarrenMB over 10 years
    This is my preferred way to move the files now. One warning; only do < 20 files at a time between commits otherwise it can be very timeconsuming to find the files that relate to each other.
  • Cees Timmerman
    Cees Timmerman about 10 years
    Since that link could break, you may want to copy the relevant info into your answer.
  • RoeeK
    RoeeK over 8 years
    the simplest and the most accurate answer is that one! using TortoiseSVN moving files is done with right-click > rename. that's it.
  • Bondax
    Bondax about 8 years
    @DarrenMB is right: I'm about to migrate an Android Project from Eclipse to Android Studio. All files have to be moved. This approach is not the one i want to use here.
  • Keith
    Keith about 8 years
    @Bondax yes, for migrations of entire projects you're better off doing the move from within SVN - that should be something you do very occasionally. I found this the better way for the majority of file moves done by most developers during a project.
  • Mark Patterson
    Mark Patterson over 7 years
    I don't have Repair Move either, using tortoise SVN 1.9.4
  • ripvlan
    ripvlan over 6 years
    I know this is years later -- but Joe's comment is important. i struggled with this too - I overlooked that little note in the answer. The destination Folder must be under SVN control otherwise this won't work. Thankfully SVN allows adding empty folders. After placing the folder under SVN control the Right-mouse Drag will operate as described above. Otherwise the generic Windows "Copy here/move here/cancel" menu is presented (ie. SVN choices are missing).
  • Yosko
    Yosko over 6 years
    @Mark Patterson: I see the option and I am also on 1.9.4 (TortoiseSVN 1.9.4, Build 27285, and Subversion 1.9.4, -release). I don't think your problem is version related... Here is the official documentation of this feature: tortoisesvn.net/repairmoves.html
  • Stuart.Sklinar
    Stuart.Sklinar about 6 years
    ...And that link has broken. Point and case.
  • Nick
    Nick about 5 years
    Tip: When viewing SVN Logs for a repository, at the bottom of the Log window there is a checkbox to "Stop on copy/rename". You need to uncheck that, if you want history from the directory prior to the move to be shown in the Log.
  • Joe
    Joe almost 5 years
    Or another way to say it: svn move <current path/filename> <destination path/filename>
  • Michael Murphy
    Michael Murphy almost 5 years
    This was perfect. I had some issues moving over 1,500 files in one go. Moving them one directory at a time seemed to get rid of this issue though.