How do I move a file (or folder) from one folder to another in TortoiseSVN?

151,722

Solution 1

To move a file or set of files using Tortoise SVN, right-click-and-drag the target files to their destination and release the right mouse button. The popup menu will have a SVN move versioned files here option.

Note that the destination folder must have already been added to the repository for the SVN move versioned files here option to appear.

Solution 2

svn move — Move a file or directory.

http://svnbook.red-bean.com/en/1.0/re18.html

Solution 3

In Windows Explorer, with the right-mouse button, click and drag the file from where it is to where you want it. Upon releasing the right-mouse button, you will see a context menu with options such as "SVN Move versioned file here".

http://tortoisesvn.net/most-forgotten-feature

Solution 4

Under TortoiseSVN, see the following page: http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-copy.html

Solution 5

If you want to move files around and keep the csproj files up to date, the easiest way is to use a Visual Studio plugin like AnkhSVN. That will automatically commit both the move action (as an delete + add with history, because that's how Subversion works) and a change in the .csproj

Share:
151,722

Related videos on Youtube

jeremcc
Author by

jeremcc

Software developer, currently focused on ASP.NET MVC, jQuery, Entity Framework and raising two awesome kids.

Updated on July 10, 2020

Comments

  • jeremcc
    jeremcc almost 4 years

    I would like to move a file or folder from one place to another within the same repository without having to use Repo Browser to do it, and without creating two independent add/delete operations. Using Repo Browser works fine except that your code will be hanging in a broken state until you get any supporting changes checked in afterwards (like the .csproj file for example).

    Update: People have suggested "move" from the command line. Is there a TortoiseSVN equivalent?

  • nuthan ratnam vara
    nuthan ratnam vara almost 15 years
    I needed to do the same and this worked perfectly. Never knew about this option. Big thanks!
  • Yoh Suzuki
    Yoh Suzuki almost 13 years
    Thank you! Note: Afterwards, it shows in the change log a bunch of DELETED and ADDED files and directories, but the revision history does follow the files around. :)
  • Shawn Mclean
    Shawn Mclean over 12 years
    What do I do if I already moved the file but svn still thinks its in another directory?
  • icc97
    icc97 about 12 years
    You also (certainly in v1.7.6) need to make sure that the directory you are moving the files is already added subversion
  • Cyril Gandon
    Cyril Gandon over 11 years
    Legendary answer made my day, ty!
  • Thomas Franz
    Thomas Franz almost 9 years
    it should be mentioned that you have to use the Windows Explorer to move. Tools like the Total Commander did not support this feature.
  • Trebor Rude
    Trebor Rude almost 9 years
    While I prefer answers that involve the portable svn command line to answers that use an OS-specific tool like Tortoise SVN (even though I see the OP specifically asked for a Tortoise SVN answer, I still think the best answer would include both options), the comment that "the destination folder must have already been added to the repository" helped me resolve the error I was getting from the Linux command-line client, so you get the upvote.
  • greggo
    greggo over 7 years
    Of course there must be a subsequent commit, which sends the change to the repo; you can edit the files before committing (e.g. to fix paths...) But any commit must include both the deleted dir and the added dir (or neither); the simplest thing is to commit at a common containing directory. But if you have unrelated mods in the common tree which you do not want to commit at the same time, that may not be an option; a command line allows you to name both of the affected dirs directly and sidestep this issue.