<?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>Aanjhan RANGANATHAN&#039;s blog &#187; dvcs</title>
	<atom:link href="http://www.tuxmaniac.com/blog/tag/dvcs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tuxmaniac.com</link>
	<description>Technology, Science, Education, Travel, Photography, Books and life . . .</description>
	<lastBuildDate>Tue, 11 Oct 2011 13:09:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Setting up a remote git server</title>
		<link>http://www.tuxmaniac.com/blog/2009/12/14/setting-up-a-remote-git-server/</link>
		<comments>http://www.tuxmaniac.com/blog/2009/12/14/setting-up-a-remote-git-server/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 11:32:33 +0000</pubDate>
		<dc:creator>aanjhan</dc:creator>
				<category><![CDATA[fedora]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[dvcs]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[remote server]]></category>

		<guid isPermaLink="false">/?p=201</guid>
		<description><![CDATA[For the past 1 month, especially en-route preparations for FOSS.IN 2009 I wanted to have a complete repository on my hard disk from where people can checkout, commit src code, schematics, technology information and do whatever needed without the necessity of INTERNET connectivity. Thats where git drew my attention. I have been a cvs / [...]]]></description>
			<content:encoded><![CDATA[<p>For the past 1 month, especially en-route preparations for <a href="http://foss.in/2009">FOSS.IN 2009</a> I wanted to have a complete repository on my hard disk from where people can checkout, commit src code, schematics, technology information and do whatever needed without the necessity of INTERNET connectivity. Thats where <a href="http://git-scm.com/">git</a> drew my attention. I have been a cvs / svn user for long time now and the very fundamental design aspect of git / any <a href="http://en.wikipedia.org/wiki/Distributed_revision_control">distributed version control system</a> makes me happy as it is just what a developer like me needs.</p>
<p>So here goes a quick how-to (more of a note to self) on how I setup a remote git repo on one of the servers I have ssh access to.</p>
<p>1. <a href="http://en.wikipedia.org/wiki/Secure_Shell">SSH</a> into your remote server (ssh uname@remoteserver)</p>
<p>2. Say, you are starting off setting up a git setup on this remote server. Create a directory by name say git (In the below example I put it in the home directory). All projects shall go into this directory.</p>
<p style="padding-left: 30px;"><strong><span style="color: #808080;"><em> uname@remoteserver$ mkdir ~/git</em></span></strong></p>
<p>3. Now, create a project.git directory. If your project name is ledblink then do the following.</p>
<p style="padding-left: 30px;"><strong><span style="color: #808080;"><em> uname@remoteserver$ mkdir ~/git/ledblink.git</em></span></strong></p>
<p>4. Initialise a bare git directory</p>
<p style="padding-left: 30px;"><span style="color: #888888;"><em> <span style="color: #808080;"><strong>uname@remoteserver$ cd ~/git/ledblink.git</strong></span></em></span></p>
<p style="padding-left: 30px;"><span style="color: #808080;"><strong><em> uname@remoteserver/git/ledblink.git$ git &#8211; -bare init</em></strong></span></p>
<p>5. Edit the description file to describe the project [Optional of-course]. Then edit the config file to enable reposharing by adding the line &#8220;<em>sharedrepository = 1</em>&#8221; under the [core] section.</p>
<p>6. Setup appropriate permissions. In the below example user only rights.</p>
<p style="padding-left: 30px;"><em> <span style="color: #808080;"><strong>uname@remoteserver/git/ledblink.git$ chmod -R g=u .</strong></span></em></p>
<p style="padding-left: 30px;"><span style="color: #808080;"><strong><em> uname@remoteserver/git/ledblink.git$ find . -type d | xargs chmod g+s</em></strong></span></p>
<p>So all is done on the server side. Go back to your local machine.</p>
<p>7. Go to the folder you want to be version control or create a fresh directory where you will put your project files. Lets say localprojectrepo is the directory name. Change directory into the localprojectrepo and do the following.</p>
<p style="padding-left: 30px;"><em> <span style="color: #808080;"><strong>uname@localhost/localprojectrepo$ git init</strong></span></em></p>
<p style="padding-left: 30px;"><em> <span style="color: #808080;"><strong>uname@localhost/localprojectrepo$ touch samplefile.txt</strong></span></em></p>
<p style="padding-left: 30px;"><span style="color: #808080;"><strong><em> uname@localhost/localprojectrepo$ git add .</em></strong></span></p>
<p style="padding-left: 30px;"><span style="color: #808080;"><strong><em> uname@localhost/localprojectrepo$ git commit -m &#8220;First commit&#8221;</em></strong></span></p>
<p>Your local git repository is created. Now lets add the server as remote so that a push &#8220;syncs&#8221; the changes to the remote server.</p>
<p style="padding-left: 30px;"><em> <span style="color: #808080;"><strong>uname@localhost/localprojectrepo$ git remote add origin uname@remoteserver:&lt;pathto&gt;/git/ledblink.git</strong></span></em></p>
<p style="padding-left: 30px;"><span style="color: #808080;"><strong><em> uname@localhost/localprojectrepo$ git push origin master</em></strong></span></p>
<p>Life is good! To take backups of your remote git repo, use your favourite means to copy the ~/git directory you create on the remote server. Thanks to good old friend <a href="http://web.gnuer.org/blog/index.php">Anurag</a> for helping me through the details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuxmaniac.com/blog/2009/12/14/setting-up-a-remote-git-server/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

