<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">
<sect1 id="tsvn-dug-copy">
  <title>Copying/Moving/Renaming Files and Folders</title>
  <indexterm>
    <primary>copy files</primary>
  </indexterm>
  <indexterm>
    <primary>rename files</primary>
  </indexterm>
  <indexterm>
    <primary>move files</primary>
  </indexterm>
  <indexterm>
    <primary>branch</primary>
  </indexterm>
  <indexterm>
    <primary>tag</primary>
  </indexterm>
  <para>
    It often happens that you already have the files you need in another
    project in your repository, and you simply want to copy them across.
    You could simply copy the files and add them, but
    that would not give you any history. And if you subsequently fix a bug
    in the original files, you can only merge the fix automatically if the
    new copy is related to the original in Subversion.
  </para>
  <para>
    The easiest way to copy files and folders from within a working copy is
    to use the right drag menu. When you <action>right drag</action> a file
    or folder from one working copy to another, or even within the same
    folder, a context menu appears when you release the mouse.
    <figure id="tsvn-dug-copy-right-drag">
      <title>Right drag menu for a directory under version control</title>
      <graphic fileref="../images/RightDragMenu.png"/>
    </figure>
    Now you can copy existing versioned content to a new location, possibly
    renaming it at the same time.
  </para>
  <para>
    You can also copy or move versioned files within a working copy, or between two
    working copies, using the familiar cut-and-paste method. Use the standard Windows
    <action>Copy</action> or <action>Cut</action> to copy one or more versioned items
    to the clipboard. If the clipboard contains such versioned items, you can then use
    <menuchoice>
      <guimenu>TortoiseSVN</guimenu>
      <guimenuitem>Paste</guimenuitem>
    </menuchoice>
    (note: not the standard Windows <action>Paste</action>)
    to copy or move those items to the new working copy location.
  </para>
  <para>
    You can copy files and folders from your working copy to another
    location in the repository using
    <menuchoice>
      <guimenu>TortoiseSVN</guimenu>
      <guimenuitem>Branch/Tag</guimenuitem>
    </menuchoice>.
    Refer to <xref linkend="tsvn-dug-branch-1"/> to find out more.
  </para>
  <para>
    You can locate an older version of a file or folder in the log
    dialog and copy it to a new location in the repository directly
    from the log dialog using
    <menuchoice>
      <guimenu>Context menu</guimenu>
      <guimenuitem>Create branch/tag from revision</guimenuitem>
    </menuchoice>.
    Refer to <xref linkend="tsvn-dug-showlog-2"/> to find out more.
  </para>
  <para>
    You can also use the repository browser to locate content you want,
    and copy it into your working copy directly from the repository,
    or copy between two locations within the repository.
    Refer to <xref linkend="tsvn-dug-repobrowser"/> to find out more.
  </para>
  <tip>
    <title>Cannot copy between repositories</title>
    <para>
      Whilst you can copy or move files and folders <emphasis>within</emphasis>
      a repository, you <emphasis>cannot</emphasis> copy or move from one
      repository to another while preserving history using TortoiseSVN.
      Not even if the repositories live on the same server. All you can
      do is copy the content in its current state and add it as new
      content to the second repository.
    </para>
    <para>
      If you are uncertain whether two URLs on the same server refer
      to the same or different repositories, use the repo browser to
      open one URL and find out where the repository root is.
      If you can see both locations in one repo browser window then
      they are in the same repository.
    </para>
  </tip>
</sect1>
