<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 SYSTEM "../../../dtd/dblite.dtd">
<sect1 id="tsvn-dug-relocate">
	<title>Relocating a working copy</title>
	<indexterm>
		<primary>relocate</primary>
	</indexterm>
	<indexterm>
		<primary>URL changed</primary>
	</indexterm>
	<indexterm>
		<primary>repository URL changed</primary>
	</indexterm>
	<indexterm>
		<primary>server moved</primary>
	</indexterm>
	<indexterm>
		<primary>moved server</primary>
	</indexterm>
	<?dbhh topicname="HIDD_RELOCATE"?>
	<para>
		<figure id="tsvn-dug-relocate-dia-1">
			<title>The Relocate Dialog</title>
			<graphic fileref="../images/Relocate.png"/>
		</figure>
		If your repository has for some reason changed it's
		location (IP/URL). Maybe you're even stuck and can't
		commit and you don't want to checkout your working
		copy again from the new location and to move all your
		changed data back into the new working copy,
		<menuchoice>
			<guimenu>TortoiseGit</guimenu>
			<guimenuitem>Relocate</guimenuitem>
		</menuchoice>
		is the command you are looking for. It basically
		does very little: it scans all <filename>entries</filename> files in the
		<filename>.svn</filename> folder and changes the URL of
		the entries to the new value.
	</para>
	<para>
		You may be surprised to find that TortoiseGit contacts the repository
		as part of this operation. All it is doing is performing some simple
		checks to make sure that the new URL really does refer to the same
		repository as the existing working copy.
	</para>
	<warning>
		<para>
			<emphasis>This is a very infrequently used operation</emphasis>.
			The relocate command is <emphasis>only</emphasis> used if the URL of the
			repository root has changed. Possible reasons are:
			<itemizedlist>
				<listitem>
					<para>The IP address of the server has changed.</para>
				</listitem>
				<listitem>
					<para>The protocol has changed (e.g. http:// to https://).</para>
				</listitem>
				<listitem>
					<para>The repository root path in the server setup has changed.</para>
				</listitem>
			</itemizedlist>
			Put another way, you need to relocate when your working copy is referring
			to the same location in the same repository, but the repository itself
			has moved.
		</para>
		<para>
			It does not apply if:
			<itemizedlist>
				<listitem>
					<para>
						You want to move to a different Git repository. In that case
						you should perform a clean checkout from the new repository location.
					</para>
				</listitem>
				<listitem>
					<para>
						You want to switch to a different branch or directory within the 
						same repository. To do that you should use
						<menuchoice>
							<guimenu>TortoiseGit</guimenu>
							<guimenuitem>Switch...</guimenuitem>
						</menuchoice>.
						Read <xref linkend="tsvn-dug-switch-1"/> for more information.
					</para>
				</listitem>
			</itemizedlist>
		</para>
		<para>
			If you use relocate in either of the cases above, it
			<emphasis>will corrupt your working copy</emphasis> and you will get many
			unexplainable error messages while updating, committing, etc.
			Once that has happened, the only fix is a fresh checkout.
		</para>
	</warning>
</sect1>
