<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LRBlog &#187; Git</title>
	<atom:link href="http://blog.lrdesign.com/category/development/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lrdesign.com</link>
	<description>Logical Reality Design: Web Design and Software Development</description>
	<lastBuildDate>Thu, 08 Jul 2010 01:40:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Changing the origin of your git repository</title>
		<link>http://blog.lrdesign.com/2008/07/changing-the-origin-of-your-git-repository/</link>
		<comments>http://blog.lrdesign.com/2008/07/changing-the-origin-of-your-git-repository/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 21:02:38 +0000</pubDate>
		<dc:creator>Evan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[origin]]></category>
		<category><![CDATA[repository]]></category>

		<guid isPermaLink="false">http://blog.lrdesign.com/?p=41</guid>
		<description><![CDATA[This is pretty basic and there's plenty of documentation on the web, but this morning I found it difficult to locate with a google search. Maybe I just didn't know the right terms. (searching "git repository change origin" seems obvious to me, but the results were useless.) Hopefully this post will help people find the [...]]]></description>
			<content:encoded><![CDATA[<p>This is pretty basic and there's plenty of documentation on the web, but this morning I found it difficult to locate with a google search.  Maybe I just didn't know the right terms.  (searching "git repository change origin" seems obvious to me, but the results were useless.)  Hopefully this post will help people find the documentation they are looking for if they are searching the same way I was.</p>
<p>Anyway, suppose you have a local git repository that you cloned from some remote repository at, say <code>git://user@dev.foo.com/git/repos/path</code>, and you've been happily <code>pull</code>ing, <code>push</code>ing and <code>rebase</code>ing to and from that remote repository.  But now you or your team leader have moved that remote repository to a new location, and you'd like to point your repository to the new URL without having to do a full checkout.   </p>
<p>What you need to do is change your 'origin' setting.   Unfortunately, there's no trivially easy way to do this from the command line in current versions of git.   Instead, you edit <code>.git/config</code> in your project root, which may look something like this:</p>
<p><code>...<br />
[remote "origin"]<br />
        url = git://user@dev.foo.com/git/repos/path<br />
        fetch = +refs/heads/*:refs/remotes/origin/*<br />
...</code></p>
<p>or if your 'remote' is actually local:</p>
<p><code>...<br />
[remote "origin"]<br />
        url = /path/to/repos/on/this/machine<br />
        fetch = +refs/heads/*:refs/remotes/origin/*<br />
...</code></p>
<p>All you need to do is edit that file with your favorite editor and change the <code>url =</code> setting to your new location.   Assuming the new repository is correctly set up and you have your URL right, you'll be happily pushing and pulling to and from your new remote location.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lrdesign.com/2008/07/changing-the-origin-of-your-git-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
