<?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>Giordano Scalzo&#039;s Personal Blog &#187; git</title>
	<atom:link href="http://giordano.scalzo.biz/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://giordano.scalzo.biz</link>
	<description>Just another useless weblog</description>
	<lastBuildDate>Mon, 09 May 2011 09:50:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Private git repositories on Site5</title>
		<link>http://giordano.scalzo.biz/2009/08/28/private-git-repositories-on-site5/</link>
		<comments>http://giordano.scalzo.biz/2009/08/28/private-git-repositories-on-site5/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 21:51:18 +0000</pubDate>
		<dc:creator>giordano scalzo</dc:creator>
				<category><![CDATA[tutorial]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[site5]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.scalzo.biz/?p=12</guid>
		<description><![CDATA[It happens I have a shared host on Site5 and it happens most of kool koders are moving to git. I&#8217;m not a so kool koder, but I think git deserve a try. I know Github offers a wonderful service for open source projects, and I tried it for a bunch of pet works, but [...]]]></description>
			<content:encoded><![CDATA[<p>It happens I have a shared host on <a href="http://www.site5.com">Site5</a> and it happens most of kool koders are moving to <a href="http://www.git-scm.com">git</a>.<br />
I&#8217;m not a so kool koder, but I think <a href="http://www.git-scm.com">git</a> deserve a try.</p>
<p>I know <a href="http://www.github.com">Github</a> offers a wonderful service for open source projects, and I tried it for a bunch of pet works, but something is better to keep private, so, some month ago, I tried to set up a <a href="http://www.git-scm.com">git</a> repository on my <a href="http://www.site5.com">Site5</a> account without success.</p>
<p>Some day ago, I bumped into a <a href="http://mark.ryall.name/blog/2008/08/17/using-git-on-site5-the-details/">couple</a> of <a href="http://rwmj.wordpress.com/2009/03/06/git-fatal-no-matching-remote-head/">posts</a> and, finally, I reached my goal.</p>
<h4>Set up a password-less connection</h4>
<p><a href="http://www.git-scm.com">git</a> communication is based on ssh, but a password request each &#8216;git push&#8217; or &#8216;git pull&#8217; can be annoying in day-by-day working, so the first thing is to make our connection trusted by the server.<br />
In  <a href="http://mark.ryall.name/blog/2008/08/17/using-git-on-site5-the-details/">this post</a>, we can find detailed instructions for a Linux system:</p>
<pre class="brush: bash; gutter: false">user@localhost:~$ ssh-keygen -t dsa
user@localhost:~$ scp ~/.ssh/id_dsa.pub remoteuser@remotehost:
user@localhost:~$ ssh remoteuser@remotehost:
[remoteuser@remotehost ~]$ cat id_dsa.pub &gt;&gt; .ssh/authorized_keys</pre>
<p>For other OS, Google is your <a href="http://www.google.it/search?q=ssh+without+password+windows/">friend</a>.</p>
<h4>Create a repository on Site5</h4>
<p>Some month ago, all <a href="http://www.site5.com">Site5</a>&#8216;s servers <a href="http://www.site5.com/blog/s5/updated-git/20090422/">migrated</a> to the last version of <a href="http://www.git-scm.com">git</a> , but if you can&#8217;t find it installed, you can open a ticket: <a href="http://www.site5.com">Site5</a>&#8216;s support is always friendly and quick.<br />
Now we can create our repository:</p>
<pre class="brush: bash; gutter: false">[remoteuser@remotehost ~]$ mkdir -p git/repo.git
[remoteuser@remotehost ~]$ cd git/repo.git
[remoteuser@remotehost ~]$ git --bare init
[remoteuser@remotehost ~]$ exit</pre>
<p>and create our local repository:</p>
<pre class="brush: bash; gutter: false">user@host:~$ mkdir git
user@host:~$ cd git
user@host:~$ git clone ssh://remoteuser@remotehost/~/git/repo.git

user@host:~$ echo 'Here we go' &gt; README
user@host:~$ git add .
user@host:~$ git commit
user@host:~$ git push</pre>
<h4>Fixing “fatal: no matching remote head”-error</h4>
<p>After that, when I tried to push my modifies I got an “fatal: no matching remote head” error&#8230; fortunately I wasn&#8217;t <a href="http://rwmj.wordpress.com/2009/03/06/git-fatal-no-matching-remote-head/">alone</a> with that problem.<br />
First of all we need create an empty local repository then tell <a href="http://www.git-scm.com">git</a> that the &#8220;origin&#8221; of the local repository is the remote repository</p>
<pre class="brush: bash; gutter: false">
user@host:~$ cd repo
user@host:~$ git init
user@host:~$ echo 'Here we go' &gt; README
user@host:~$ git add .
user@host:~$ git commit -ma ''
user@host:~$ git push
user@host:~$ git remote add origin ssh://remotehost/~/git/repo.git
</pre>
<p>Then we have to connect the upstream &#8220;origin&#8221; with the current local branch:</p>
<pre class="brush: bash; gutter: false">vi .git/config</pre>
<p>and adding the following at the bottom:</p>
<pre class="brush: bash; gutter: false">[branch "master"]
  remote = origin
  merge = refs/heads/master</pre>
<p>Finally we have to synchronize remote with local repository:</p>
<pre class="brush: bash; gutter: false">git push origin master</pre>
<p>After that</p>
<pre class="brush: bash; gutter: false">git push</pre>
<p>and</p>
<pre class="brush: bash; gutter: false">git pull</pre>
<p>should work without problem</p>
<h4>Conclusion</h4>
<p>When discovered all necessary steps, any new repository installation goes smooth; in this post I tried to be complete and gather all the necessary informations.<br />
If you are new to <a href="http://www.git-scm.com">git</a> in <a href="http://blog.xebia.com/2009/01/26/git-101/">this</a> page you will find some useful links.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/git' rel='tag' target='_self'>git</a>, <a class='technorati-link' href='http://technorati.com/tag/site5' rel='tag' target='_self'>site5</a>, <a class='technorati-link' href='http://technorati.com/tag/ssh' rel='tag' target='_self'>ssh</a>, <a class='technorati-link' href='http://technorati.com/tag/tutorial' rel='tag' target='_self'>tutorial</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://giordano.scalzo.biz/2009/08/28/private-git-repositories-on-site5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

