<?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>Fedora &#187; Git</title>
	<atom:link href="http://gofedora.com/archives/category/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://gofedora.com</link>
	<description>How Tos, Tutorials, Tips and Tricks</description>
	<lastBuildDate>Thu, 17 May 2012 04:44:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Getting Started With Git</title>
		<link>http://gofedora.com/getting-started-with-git/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-git</link>
		<comments>http://gofedora.com/getting-started-with-git/#comments</comments>
		<pubDate>Thu, 17 May 2012 04:44:58 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[Summer Hacking]]></category>

		<guid isPermaLink="false">http://gofedora.com/?p=1125</guid>
		<description><![CDATA[I have been using Git for years now and I am still a novice user. Actually, if you are an individual developer or work in a really small team, you don&#8217;t really need to go beyond using the basic stuff like cloning a repo, committing code, branching and pushing back to the origin repo. And [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://gofedora.com/getting-started-with-git/' addthis:title='Getting Started With Git '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p></p><p>I have been using <a href="http://git-scm.com/" target="_blank">Git</a> for years now and I am still a novice user. Actually, if you are an individual developer or work in a really small team, you don&#8217;t really need to go beyond using the basic stuff like cloning a repo, committing code, branching and pushing back to the origin repo. And that&#8217;s exactly what happened with me. Working alone most of the times and working in my own repos. I never felt the need to explore advanced usage.</p>
<p>Last week, we didn&#8217;t have internet at home for like four days. So, I thought I&#8217;ll read a book. I downloaded <a href="http://git-scm.com/book" target="_blank">ProGit : The Free Git Book</a> and started reading. It&#8217;s an awesomely written book. I learned a lot of new things about Git. A few more concept about using branches efficiently. If you are a Git beginner or looking forward to getting started with Git and you don&#8217;t like reading too much, I&#8217;ll suggest that you read at least first three chapters thoroughly. That along with a free <a href="http://github.com/" target="_blank">GitHub</a> account should be enough to get you going if you are not going to be a heavy Git user soon.</p>
<p><a href="http://gofedora.com/">Fedora Tutorials</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://gofedora.com/getting-started-with-git/' addthis:title='Getting Started With Git '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/getting-started-with-git/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Summer Hacking</title>
		<link>http://gofedora.com/summer-hacking/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=summer-hacking</link>
		<comments>http://gofedora.com/summer-hacking/#comments</comments>
		<pubDate>Fri, 11 May 2012 20:03:17 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Bootstrap]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SCSS]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Summer Hacking]]></category>

		<guid isPermaLink="false">http://gofedora.com/?p=1121</guid>
		<description><![CDATA[Summer has already started and we (a small group of current and ex-IIITians in Hyderabad) are planning to have some fun digging into Ruby on Rails and related technologies. If you are also interested in utilizing your summer in a productive and fun way, you can join us and share your knowledge while learning from [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://gofedora.com/summer-hacking/' addthis:title='Summer Hacking '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p></p><p>Summer has already started and we (a small group of current and ex-IIITians in Hyderabad) are planning to have some fun digging into Ruby on Rails and related technologies. If you are also interested in utilizing your summer in a productive and fun way, you can join us and share your knowledge while learning from the rest of the members at the same time.</p>
<p>Assuming that all of us know at least one programming language (C/C++/Python), below is the list of things we are planning to learn.</p>
<ol>
<li>Ruby</li>
<ul>
<li>If you already know a programming language, it&#8217;ll not be difficult for you to pick up Ruby.</li>
<li>In case you happen to know Python, you&#8217;ll feel at home.</li>
<li>Spend a good half an hour on <a href="http://www.ruby-lang.org/en/documentation/quickstart/" target="_blank">Ruby In Twenty Minutes</a> and you&#8217;ll know how simple and beautiful Ruby is.</li>
<li>Once you are done with Ruby quick-starter, you can <a href="http://tryruby.org/levels/1/challenges/0" target="_blank">try ruby in your browser</a> and have some fun.</li>
<li>Please go through <a href="https://github.com/styleguide/ruby" target="_blank">Ruby Style Guide</a> to see how to write beautiful and easy to understand Ruby code.</li>
</ul>
<li>Rails</li>
<ul>
<li>If you have worked with any MVC framework in past, you&#8217;ll pickup rails quite easily.</li>
<li>If you have worked with Web2py, then go through this <a href="http://www.slideshare.net/jonromero/rails-vs-web2py" target="_blank">Rails vc Web2py presentation</a> which tries to show similarities among both frameworks.</li>
<li><a href="http://guides.rubyonrails.org/" target="_blank">RailsGuides</a> is one of best and complete documentation for getting started with Ruby on Rails. It may look like a lot of content to beginners. If that&#8217;s the case with you, you can skip the guides in Digging Deeper section.</li>
<li><a href="http://railscasts.com/?type=free" target="_blank">RailsCasts</a> is  like a sea of quality Ruby on Rails screencasts. Watch a few on topics where you may have doubts.</li>
</ul>
<li>jQuery</li>
<ul>
<li>We&#8217;ll be learning <a href="http://jquery.com/" target="_blank">jQuery</a> assuming that all of us are already familiar with JavaScript.</li>
<li>We&#8217;ll learn only basics initially and explore more as we start using it in a Rails project.</li>
</ul>
<li>CoffeeScript</li>
<ul>
<li><a href="http://coffeescript.org/" target="_blank">CoffeeScript</a> is a language that compiles to JavaScript but it&#8217;s way more beautiful to look at and easier to read and understand.</li>
<li>We&#8217;ll not write JavaScript code for our Rails app. Instead, we&#8217;ll be writing CoffeeScript!</li>
</ul>
<li>SCSS</li>
<ul>
<li><a href="http://sass-lang.com/" target="_blank">SCSS</a> is an extension of CSS3. It&#8217;s fun to write stylesheets using SCSS as it brings in additional features like variables, nested rules etc.</li>
<li>SCSS will ultimately be compiled to CSS.</li>
<li>Again, there is not much to do here. Half an hour to familiarize yourself with the syntax and you are ready to roll.</li>
</ul>
<li>Twitter Bootstrap</li>
<ul>
<li><a href="http://twitter.github.com/bootstrap/" target="_blank">Bootstrap</a> is a super simple and crazy awesome CSS and JavaScript toolkit developed by twitter.</li>
<li>We&#8217;ll be using bootstrap to power our Rails apps which we&#8217;ll build at a later stage.</li>
<li>Nothing much to learn here. It&#8217;s more about getting familiar with commonly used classes.</li>
</ul>
<li>Git and GitHub</li>
<ul>
<li>We&#8217;ll be using <a href="http://git-scm.com/" target="_blank">Git</a> for tracking code while building our apps.</li>
<li>We&#8217;ll learn about basic Git functions like cloning a repository, committing code, pushing code to a remote repository, working in different branches etc.</li>
<li>Go through <a href="http://git-scm.com/book/en/Git-Basics-Getting-a-Git-Repository" target="_blank">Git Basics</a> and we can learn more as we start using it full time.</li>
<li>We&#8217;ll be using <a href="http://github.com/" target="_blank">GitHub</a> to host all our code. If you don&#8217;t have an account already, get one.</li>
</ul>
</ol>
<p>We&#8217;ll learn these technologies while working regularly at our work places. Once in a while, we&#8217;ll meet and share our experiences and knowledge. The plan is to spend one or two weeks to go through basic stuff in all the topics. After that we can start a dummy rails project and learn more as we go.</p>
<p>If you are not in Hyderabad and still want to join, just start exploring and we can connect online! Happy Hacking!!!</p>
<p><a href="http://gofedora.com/">Fedora Tutorials</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://gofedora.com/summer-hacking/' addthis:title='Summer Hacking '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/summer-hacking/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To: Install and Use Twython (Python Wrapper for Twitter API)</title>
		<link>http://gofedora.com/how-to-install-use-twython-python-wrapper-for-twitter-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-install-use-twython-python-wrapper-for-twitter-api</link>
		<comments>http://gofedora.com/how-to-install-use-twython-python-wrapper-for-twitter-api/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 07:49:51 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Code Demo]]></category>
		<category><![CDATA[Proxy Support]]></category>
		<category><![CDATA[Twitter API]]></category>
		<category><![CDATA[Twython]]></category>

		<guid isPermaLink="false">http://gofedora.com/?p=826</guid>
		<description><![CDATA[As promised in my previous post, here is a brief howto on getting started with twython. The main advantage of Twython over several other python (or any other language) wrappers for Twitter API is that it works even when you are behind your organizations proxy. Download Twython You can download latest version of twython from [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://gofedora.com/how-to-install-use-twython-python-wrapper-for-twitter-api/' addthis:title='How To: Install and Use Twython (Python Wrapper for Twitter API) '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p></p><p>As promised in my <a href="http://gofedora.com/love-twitter-love-python-love-twython/" target="_blank">previous post</a>, here is a brief howto on getting started with twython. The main advantage of Twython over several other python (or any other language) wrappers for Twitter API is that it works even when you are behind your organizations proxy.</p>
<h3><span style="text-decoration: underline;"><strong>Download Twython</strong></span></h3>
<p>You can download latest version of twython from <a href="http://github.com/ryanmcgrath/twython/tree/master" target="_blank">twython page on github</a>. You can either clone using git (if you have git installed) or can click the download button.</p>
<h3><span style="text-decoration: underline;"><strong>Install Twython</strong></span></h3>
<p>Once you are done with extracting the downloaded tar file. Change directory to twython and run these command as root.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fedora ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> clone <span style="color: #c20cb9; font-weight: bold;">git</span>:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>ryanmcgrath<span style="color: #000000; font-weight: bold;">/</span>twython.git
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fedora ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> twython<span style="color: #000000; font-weight: bold;">/</span>dist
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fedora dist<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> twython-<span style="color: #000000;">0.8</span>.tar.gz
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fedora dist<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #7a0874; font-weight: bold;">cd</span> twython-<span style="color: #000000;">0.8</span><span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fedora dist<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ python setup.py build
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>fedora dist<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<h3><span style="text-decoration: underline;"><strong>Use Twython from Python Interpreter</strong></span></h3>
<p>Below is a direct copy paste lines from my interpreter. See how things are working (learning by doing).</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: black;">&#91;</span>saini@bordeaux ~<span style="color: black;">&#93;</span>$ python
Python <span style="color: #ff4500;">2.6</span> <span style="color: black;">&#40;</span>r26:<span style="color: #ff4500;">66714</span>, Mar <span style="color: #ff4500;">17</span> <span style="color: #ff4500;">2009</span>, <span style="color: #ff4500;">11</span>:<span style="color: #ff4500;">44</span>:<span style="color: #ff4500;">21</span><span style="color: black;">&#41;</span> 
<span style="color: black;">&#91;</span>GCC 4.4.0 <span style="color: #ff4500;">20090313</span> <span style="color: black;">&#40;</span>Red Hat 4.4.0-<span style="color: #ff4500;">0.26</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span> on linux2
Type <span style="color: #483d8b;">&quot;help&quot;</span>, <span style="color: #483d8b;">&quot;copyright&quot;</span>, <span style="color: #483d8b;">&quot;credits&quot;</span> <span style="color: #ff7700;font-weight:bold;">or</span> <span style="color: #483d8b;">&quot;license&quot;</span> <span style="color: #ff7700;font-weight:bold;">for</span> more information.
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #808080; font-style: italic;"># first of all, import twython module</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">import</span> twython
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #808080; font-style: italic;"># Authenticate your twitter account with your twitter username</span>
... <span style="color: #808080; font-style: italic;"># and password with twitter.setup method.</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> client = twython.<span style="color: black;">setup</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Basic'</span>,<span style="color: #483d8b;">'myusername'</span>,<span style="color: #483d8b;">'mypassword'</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> client.<span style="color: black;">authenticated</span>
<span style="color: #008000;">True</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #808080; font-style: italic;">#Lets update our current status on twitter with some cool message.</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> client.<span style="color: black;">updateStatus</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Testing #twython. The coolest #TwitterAPI :)'</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #808080; font-style: italic;"># Now go and check your current status on twitter. Surprised!!!</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #808080; font-style: italic;"># Get your or anyone's followers</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> client.<span style="color: black;">getFollowersIDs</span><span style="color: black;">&#40;</span>screen_name=<span style="color: #483d8b;">'gofedora'</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #808080; font-style: italic;"># Output truncated.</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #808080; font-style: italic;"># Get help for any function.</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #ff7700;font-weight:bold;">print</span> client.<span style="color: black;">createFriendship</span>.__doc__
createFriendship<span style="color: black;">&#40;</span><span style="color: #008000;">id</span> = <span style="color: #008000;">None</span>, user_id = <span style="color: #008000;">None</span>, screen_name = <span style="color: #008000;">None</span>, follow = <span style="color: #483d8b;">&quot;false&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
	Allows the authenticating users to follow the <span style="color: #dc143c;">user</span> specified <span style="color: #ff7700;font-weight:bold;">in</span> the ID parameter.
	<span style="color: black;">Returns</span> the befriended <span style="color: #dc143c;">user</span> <span style="color: #ff7700;font-weight:bold;">in</span> the requested format when successful. <span style="color: black;">Returns</span> a
	<span style="color: #dc143c;">string</span> describing the failure condition when unsuccessful. <span style="color: black;">If</span> you are already
	friends <span style="color: #ff7700;font-weight:bold;">with</span> the <span style="color: #dc143c;">user</span> an HTTP <span style="color: #ff4500;">403</span> will be returned.
&nbsp;
	<span style="color: black;">Parameters</span>:
		<span style="color: #66cc66;">**</span> Note: One of the following <span style="color: #ff7700;font-weight:bold;">is</span> required. <span style="color: black;">&#40;</span><span style="color: #008000;">id</span>, user_id, screen_name<span style="color: black;">&#41;</span>
		<span style="color: #008000;">id</span> - Required. <span style="color: black;">The</span> ID <span style="color: #ff7700;font-weight:bold;">or</span> screen name of the <span style="color: #dc143c;">user</span> to befriend.
		<span style="color: black;">user_id</span> - Required. <span style="color: black;">Specfies</span> the ID of the <span style="color: #dc143c;">user</span> to befriend. <span style="color: black;">Helpful</span> <span style="color: #ff7700;font-weight:bold;">for</span> disambiguating when a valid <span style="color: #dc143c;">user</span> ID <span style="color: #ff7700;font-weight:bold;">is</span> also a valid screen name. 
		<span style="color: black;">screen_name</span> - Required. <span style="color: black;">Specfies</span> the screen name of the <span style="color: #dc143c;">user</span> to befriend. <span style="color: black;">Helpful</span> <span style="color: #ff7700;font-weight:bold;">for</span> disambiguating when a valid screen name <span style="color: #ff7700;font-weight:bold;">is</span> also a <span style="color: #dc143c;">user</span> ID. 
		<span style="color: black;">follow</span> - Optional. <span style="color: black;">Enable</span> notifications <span style="color: #ff7700;font-weight:bold;">for</span> the target <span style="color: #dc143c;">user</span> <span style="color: #ff7700;font-weight:bold;">in</span> addition to becoming friends. 
<span style="color: #66cc66;">&gt;&gt;&gt;</span></pre></td></tr></table></div>

<p>So now you are ready to do wonders with twython. Write your own code and blog/brag about it <img src='http://gofedora.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' title="How To: Install and Use Twython (Python Wrapper for Twitter API)" /> </p>
<p><a href="http://gofedora.com/">Fedora Tutorials</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://gofedora.com/how-to-install-use-twython-python-wrapper-for-twitter-api/' addthis:title='How To: Install and Use Twython (Python Wrapper for Twitter API) '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/how-to-install-use-twython-python-wrapper-for-twitter-api/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How To: Install and Configure GitWeb</title>
		<link>http://gofedora.com/how-to-install-configure-gitweb/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-install-configure-gitweb</link>
		<comments>http://gofedora.com/how-to-install-configure-gitweb/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 17:38:08 +0000</pubDate>
		<dc:creator>Kulbir Saini</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Tips - Tricks]]></category>
		<category><![CDATA[Clean URL]]></category>
		<category><![CDATA[Code Repository]]></category>
		<category><![CDATA[GitWeb]]></category>
		<category><![CDATA[Repository Browser]]></category>
		<category><![CDATA[Source Code Management]]></category>

		<guid isPermaLink="false">http://172.17.8.64/gofedora/?p=288</guid>
		<description><![CDATA[Goal Setting up gitweb (web interface for SCM software git) for your project&#8217;s git repository for public access and developer commits via ssh. Assumptions You already have your project&#8217;s git repository. You have hosting space somewhere to host gitweb. You have root access. You are using Apache as webserver. Example for this howto Project : [...]<p><a href="http://gofedora.com/">Fedora Tutorials</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style " addthis:url='http://gofedora.com/how-to-install-configure-gitweb/' addthis:title='How To: Install and Configure GitWeb '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div><p></p><h4><span style="text-decoration: underline;"><strong>Goal</strong></span></h4>
<p>Setting up gitweb (web interface for SCM software git) for your project&#8217;s git repository for public access and developer commits via ssh.</p>
<h4><span style="text-decoration: underline;"><strong>Assumptions</strong></span></h4>
<ol>
<li>You already have your project&#8217;s git repository.</li>
<li>You have hosting space somewhere to host gitweb.</li>
<li>You have root access.</li>
<li>You are using Apache as webserver.</li>
</ol>
<h4><span style="text-decoration: underline;"><strong>Example for this howto</strong></span></h4>
<p>Project : <a href="http://cachevideos.com" target="_blank">VideoCache</a><br />
Domain for gitweb : <a href="http://git.cachevideos.com" target="_blank">git.cachevideos.com</a><br />
URL for git access for videocache : <a href="http://git.cachevideos.com/videocache.git" target="_blank">http://git.cachevideos.com/videocache.git</a><br />
Actual path on server : <em>/home/saini/domains/cachevideos.com/git</em><br />
Git repository : <em>/home/saini/projects/videocache/</em></p>
<h4><span style="text-decoration: underline;"><strong>Installation</strong></span></h4>
<p>Installation is pretty easy. Just one single command would do everything.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># yum install gitweb (do as root)</span></pre></div></div>

<p>This will create a directory <em>/var/www/git</em> which is default for gitweb.</p>
<p>Copy the directory <em>/var/www/git/</em> to <em>/home/saini/domains/cachevideos.com/git</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cp -r /var/www/git /home/saini/domains/cachevideos.com/git</span></pre></div></div>

<h4><span style="text-decoration: underline;"><strong>Configuration</strong></span></h4>
<p><span style="text-decoration: underline;"><strong>1. GitWeb</strong></span></p>
<p>Open the file <em>/etc/gitweb.conf</em> (it may or may not be there) and add the following lines to it.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Change This</span>
<span style="color: #0000ff;">$projectroot</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'/home/saini/domains/cachevideos.com/git'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># Change This</span>
<span style="color: #0000ff;">$site_name</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;Kulbir Saini's git trees.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># Don't Change the variables below</span>
<span style="color: #0000ff;">$my_uri</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$home_link</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'/'</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">@stylesheets</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;/gitweb.css&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$favicon</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/git-favicon.png&quot;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$logo</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;/git-logo.png&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span style="text-decoration: underline;"><strong>2. Apache</strong></span></p>
<p>Open the file <em>/etc/httpd/conf.d/git.conf</em> and clear all the lines that are already there and add the following lines to it</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  DocumentRoot <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>saini<span style="color: #000000; font-weight: bold;">/</span>domains<span style="color: #000000; font-weight: bold;">/</span>cachevideos.com<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">git</span>
  ServerName git.cachevideos.com
  ErrorLog <span style="color: #ff0000;">&quot;/home/saini/domains/cachevideos.com/logs/error_log&quot;</span>
  CustomLog <span style="color: #ff0000;">&quot;/home/saini/domains/cachevideos.com/logs/access_log&quot;</span> combined
  SetEnv  GITWEB_CONFIG  <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>gitweb.conf
  DirectoryIndex gitweb.cgi
&nbsp;
    Allow from all
    AllowOverride all
    Order allow,deny
    Options +ExecCGI
    AddHandler cgi-script .cgi
&nbsp;
      SetHandler cgi-script
&nbsp;
    RewriteEngine on
    RewriteRule ^<span style="color: #7a0874; font-weight: bold;">&#91;</span>a-zA-Z0-<span style="color: #000000;">9</span>_\-<span style="color: #7a0874; font-weight: bold;">&#93;</span>+\.git<span style="color: #000000; font-weight: bold;">/</span>?<span style="color: #7a0874; font-weight: bold;">&#40;</span>\?.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>?$ <span style="color: #000000; font-weight: bold;">/</span>gitweb.cgi<span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>REQUEST_URI<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>L,PT<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p><span style="text-decoration: underline;"><strong>3. Git repository configuration</strong></span></p>
<p>Go to your git repository (<em>/home/saini/projects/videocache/</em>) and make the following changes.</p>
<p><strong>(a).</strong> Open file <em>.git/description</em> and add a short nice description for your project.</p>
<p>videocache  is  a  squid  url  rewriter plugin written in Python to facilitate youtube, metacafe, dailymotion, google, vimeo, msn soapbox,   tvuol.uol.com.br, blip.tv, break.com videos and wrzuta.pl audio caching.</p>
<p><strong>(b).</strong> Open file <em>.git/config</em> and append the following lines</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>gitweb<span style="color: #7a0874; font-weight: bold;">&#93;</span>
  owner = <span style="color: #ff0000;">&quot;Kulbir Saini&quot;</span></pre></div></div>

<h3><span style="text-decoration: underline;"><strong>Copy project&#8217;s git repository for gitweb</strong></span></h3>
<p>Copy the <em>/home/saini/projects/videocache/.git</em> directory to <em>/home/saini/domains/cachevideos.com/git/videocache.git</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cp -r /home/saini/projects/videocache/.git /home/saini/domains/cachevideos.com/git/videocache.git</span></pre></div></div>

<h4><span style="text-decoration: underline;"><strong>Finishing Step</strong></span></h4>
<p>Restart Apache webserver.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># service httpd restart</span></pre></div></div>

<p>Now you can browser a list of your projects&#8217; git repositories at <a href="http://git.cachevideos.com/" target="_blank">http://git.cachevideos.com/</a> .</p>
<h4><span style="text-decoration: underline;"><strong>Adding another project repository</strong></span></h4>
<p>Just copy the project repository&#8217;s .git directory to <em>/home/saini/domains/cachevideos.com/git/prjoect_name.git</em>. And it&#8217;ll be shown on the list.</p>
<h4><span style="text-decoration: underline;"><strong>Committing (pushing) to the repository</strong></span></h4>
<p>For committing to the repository via ssh use the following command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Pushing everything (Please see the username)</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost videocache<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># git push --all ssh://saini@git.cachevideos.com/~saini/domains/cachevideos.com/git/videocache.git</span></pre></div></div>

<p>To update tags on the remote repository use this command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Pushing all tags</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost videocache<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># git push --tags ssh://saini@git.cachevideos.com/~saini/domains/cachevideos.com/git/videocache.git</span></pre></div></div>

<p>Well, if you consider just the web interface and committing part for your project, thats all. But things can be fine tuned further. Below are few hacks!</p>
<p><span style="text-decoration: underline;"><strong>1. Enabling nice urls.</strong></span></p>
<p>By default the urls for browsing repository via git web are pretty crappy and difficult to remember. The <strong>RewriteRule</strong> and <strong>RewriteEngine</strong> lines in your Apache configuration file (<em>/etc/httpd/conf.d/git.conf</em>) takes care of that and produce nice and clean urls.</p>
<p>So you can browser the repository via <a href="http://git.cachevideos.com/videocache.git" target="_blank">http://git.cachevideos.com/videocache.git</a> instead of <a href="http://git.cachevideos.com/?p=videocache.git;a=summary" target="_blank">http://git.cachevideos.com/?p=videocache.git;a=summary</a>.</p>
<p><span style="text-decoration: underline;"><strong>2. Enabling remote ls (git-ls-remote or git ls-remote)</strong></span></p>
<p>This is the most trickiest part. If you try the command below, it won&#8217;t produce any output</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># git-ls-remote http://git.cachevideos.com/videocache.git</span></pre></div></div>

<p>You need to go to project&#8217;s repository in gitweb and then run the following command to update the server info for git.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd /home/saini/domains/cachevideos.com/git/videocache.git/</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># git-update-server-info</span></pre></div></div>

<p>Try the ls-remote command now and it should succeed by producing all the branches and tags in the remote repository.</p>
<p>But there is a problem, you have to run the above command after every commit to the remote repository. To solve this issue, you can enable post-update hook for the project&#8217;s repository in gitweb. Use the following command to enable it.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># cd /home/saini/domains/cachevideos.com/git/videocache.git/</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>localhost ~<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #666666; font-style: italic;"># chmod +x post-update</span></pre></div></div>

<p>The above command will update the server info automatically every time you commit.</p>
<p>Thats all you need to do for setting up gitweb. I hope this will be helpful.</p>
<p class="link-exchange">We are the world leaders in providing best <a href="http://www.thepass4sure.us/MB5-858-dumps.html">MB5-858</a> and  <a href="http://www.thepass4sure.biz/MB6-818.html">MB6-818</a> prep solutions. Our incredible offers for <a href="http://www.thepass4sure.me/MB7-840.html">MB7-840</a> and <a href="http://www.mypass4sure.info/70-297-dumps.html">70-297</a> exams are accessible at reasonable prices; <a href="http://www.pass4sures.biz/70-236-testking.html">70-236</a> is very rare in IT world sense.</p>
<p><a href="http://gofedora.com/">Fedora Tutorials</a> by <a href="http://saini.co.in/">Kulbir Saini</a>.</p>
<div class="addthis_toolbox addthis_default_style " addthis:url='http://gofedora.com/how-to-install-configure-gitweb/' addthis:title='How To: Install and Configure GitWeb '  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone" g:plusone:size="medium"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></content:encoded>
			<wfw:commentRss>http://gofedora.com/how-to-install-configure-gitweb/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

