<?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>ArvinderKang.com &#187; Git</title>
	<atom:link href="http://arvinderkang.com/tag/git/feed/" rel="self" type="application/rss+xml" />
	<link>http://arvinderkang.com</link>
	<description>The world is my backyard.</description>
	<lastBuildDate>Thu, 29 Jul 2010 22:58:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Automating Drupal workflow using Git and Drush</title>
		<link>http://arvinderkang.com/2009/10/29/automating-drupal-workflow-using-git-and-drush/</link>
		<comments>http://arvinderkang.com/2009/10/29/automating-drupal-workflow-using-git-and-drush/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 23:53:16 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[automate]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[drush]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2009/10/29/automating-drupal-workflow-using-git-and-drush/</guid>
		<description><![CDATA[Update Nov 11, 2009: Updated the script to accept username and server name as arguments and to print syntax help if no argument is passed. It would eliminate to modify script for different servers. Drupal rocks for some things, its &#8230; <a href="http://arvinderkang.com/2009/10/29/automating-drupal-workflow-using-git-and-drush/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Update Nov 11, 2009</strong>: <em>Updated the script to accept username and server name as arguments and to print syntax help if no argument is passed. It would eliminate to modify script for different servers.</em></p>

<p>Drupal rocks for some things, its deployment sucks! As I automate my drupal workflows better, I should post them one by one.</p>

<p>Following is the my bash script recipe, for installing drupal, checking it into a git repository and replicating it remotely.</p>

<p>The second piece of puzzle should be automating MySQL backup and deployment using either Capistrano or Vlad.</p>

<p><span id="more-199"></span>
<script src="http://gist.github.com/221965.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2009/10/29/automating-drupal-workflow-using-git-and-drush/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>In the town called Workflow, lived three friends &#8211; Git, CVS and Drupal&#8230;.</title>
		<link>http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/</link>
		<comments>http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 02:40:58 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[public-private keys]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/</guid>
		<description><![CDATA[Moving ahead on the new project, I decided to install a versioning system. I kinda have a crush on Git, however have not been using it regularly. So what better time to rekindle the old fire? I have used SVN &#8230; <a href="http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Moving ahead on the new project, I decided to install a <a href="http://en.wikipedia.org/wiki/Revision_control" title="Revision control - Wikipedia, the free encyclopedia">versioning system</a>. I kinda have a crush on Git, however have not been using it regularly. So what better time to rekindle the old fire?</p>

<p>I have used <a href="http://subversion.tigris.org/" title="subversion.tigris.org">SVN</a> in the past, however <a href="http://www.nongnu.org/cvs/" title="CVS - Open Source Version Control">CVS</a> is still the old faithful dog hosting <a href="http://drupal.org/" title="drupal.org | Community plumbing">Drupal</a> repositories. I wanted to concentrate on using <a href="http://git-scm.com/" title="Git - Fast Version Control System">Git</a>, while wanted easy way to update drupal installations.</p>

<p>After a number of blog reads, here is my workflow (atleast planned one&#8230;)</p>

<p><img src="http://arvinderkang.com/wp-content/uploads/2009/03/git-drupal-workflowpng.png" alt="Git Drupal Workflow.png" /></p>

<p><span id="more-182"></span>
Lets start by freeing ourselves from typing in password each time and allowing only public-private key authorization.</p>

<p><strong>Password free remote Login</strong></p>

<p>Following is more or less a shameless rip from <a href="http://www.debuntu.org/ssh-key-based-authentication" title="Secure your SSH server with Public/Private key authentification | Debian/Ubuntu Tips &amp; Tricks">this article</a> (Here for my own reference).</p>

<p>On my local machine, I already had generated ssh key-pair. However in the <code>~/.ssh/</code> folder I found id&#95;dsa, id&#95;dsa.pub pair along with id&#95;rsa, id&#95;rsa.pub pair. Hmmm!  A little digging into the man pages revealed the difference between RSA and DSA.</p>

<pre><code>$ man ssh-keygen
</code></pre>

<p>RSA uses 2048 for encryption by default and can vary, while DSA used exactly 1024.</p>

<p>Lets copy our public key to the server.</p>

<pre><code>$ scp ~/.ssh/id_rsa.pub myusername@myserver:~/
</code></pre>

<p>On my remote server</p>

<pre><code>$ mkdir ~/.ssh
$ cat id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys
$ rm id_rsa.pub
</code></pre>

<p>Lets activate the key</p>

<pre><code>$ sudo su -
# vi /etc/ssh/sshd_config
</code></pre>

<p>Edit the file ensure following options</p>

<pre><code>RSAAuthentication yes
PubkeyAuthentication yes
</code></pre>

<p>Save and quit vim. Relaod the configuration.</p>

<pre><code>$ sudo /etc/init.d/ssh reload
</code></pre>

<p>Now if we access the server from my client machine, it does not asks for a password.</p>

<p>Lets disable authentication by password, to shield brute-force attempts.</p>

<pre><code>$ sudo vi /etc/ssh/sshd_config
</code></pre>

<p>Edit the file ensure following options</p>

<pre><code>....
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
...
</code></pre>

<p>and reload SSH configuration file:</p>

<pre><code>$ sudo /etc/init.d/ssh reload
</code></pre>

<p>Thats it. A machine with a differnt private key would not be able to log in.</p>

<p>I also thought of making my official <a href="http://www.gnupg.org/" title="The GNU Privacy Guard - GnuPG.org">GnuPG/PGP Encryption key</a> and putting it up on the website. But thats for another day.</p>

<p>**Back to our main topic &#8211; Git-svn workflow **</p>

<p>(Inspired by <a href="http://www.versioncontrolblog.com/2007/08/02/upgrading-drupal-52-with-git/" title="Upgrading Drupal with Git | Version Control Blog">Version Control Blog</a>, <a href="http://toolmantim.com/articles/setting_up_a_new_remote_git_repository" title="Setting up a new remote git repository">ToolmanTim</a> and <a href="http://www.aidanf.net/blog/2008/03/28/managing-drupal-installation-cvs-and-git" title="Managing a drupal installation with cvs and git | aidanf.net">Aidanf</a>).</p>

<p>On my local machine</p>

<pre><code>$ mkdir -p ~/src
$ cd src
$ cvs -z9 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout -r DRUPAL-6 drupal
$ cd drupal
$ git init
$ git add .
$ git commit -m  "The inital commit of drupal6 core presently at version 6.10"
</code></pre>

<p>Now lets login to server, where we want to host the git repository for redundancy.</p>

<pre><code>$ ssh myusername@myserver
$ mkdir -p ~/gitReps/drupal.git &amp;&amp; cd  ~/gitReps/drupal.git
$ git --bare init
$ exit
</code></pre>

<p>Back on our client machine</p>

<pre><code>$ git remote
</code></pre>

<p>Nothing returns. Good we are on right track.</p>

<pre><code>$ cat .git/config
</code></pre>

<p>Returns</p>

<pre><code>[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
</code></pre>

<p>Lets add remote repository.</p>

<pre><code>git remote add myTux ssh://myusername@myserver/home/myusername/gitReps/drupal.git
</code></pre>

<p>Now above command will return</p>

<pre><code>[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "myTux"]
    url = ssh://myusername@myserver/home/myusername/gitReps/drupal.git
    fetch = refs/heads/*:refs/remotes/myTux/*
</code></pre>

<p>Running <code>git branch</code> shows just one branch locally</p>

<pre><code>* master
</code></pre>

<p>Lets push this to our remote server</p>

<pre><code>$ git push myTux master
Counting objects: 703, done.
Compressing objects: 100% (636/636), done.
Writing objects: 100% (703/703), 1.13 MiB | 1600 KiB/s, done.
Total 703 (delta 29), reused 0 (delta 0)
To ssh://myusername@myserver/home/myusername/gitReps/drupal.git
 * [new branch]      master -&gt; master
</code></pre>

<p>That is our first drupal repository. It would only carry drupal bare-bone code. Any update to drupal-core will be applied here as follows.</p>

<p>Clone the drupal on local machine and update from drupal using cvs. Then update the git and push the changes to remote server.</p>

<pre><code>$ git clone ssh://myusername@myserver/home/myusername/gitReps/drupal.git
$ cd drupal.git
$ cvs update -r DRUPAL-6.11 -dP
$ git status
$ git add .
$ git commit -m "Drupal core updated to version 6.11"
$ git push myTux master
</code></pre>

<p>Now lets create two other seperate clone of this repository. drupal-and-modules.git would keep updates repository along with updated modules and themese. drupal-production.git would keep code ready to be deployed. (I was wondering if some workaround with using branches can solve it? Any suggestions?)</p>

<p>On the server</p>

<pre><code>$ git clone drupal.git drupal-and-modules.git
</code></pre>

<p>On client machine</p>

<pre><code>$ git clone ssh://myusername@myserver/home/myusername/gitReps/drupal-and-modules.git
$ mkdir sites/all/modules
$ cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d sites/all/modules/cck -r DRUPAL-6--2-1 contributions/modules/cck
$ git add .
$ git commit -m "Imported cck 6-2.1 imported"
</code></pre>

<p>Now lets push this changed drupal to drupal-and-modules.git on remote server.</p>

<pre><code>$ git remote
origin
$ git branch
* master
$ git push origin master
Counting objects: 343, done.
Compressing objects: 100% (306/306), done.
Writing objects: 100% (336/336), 375.90 KiB, done.
Total 336 (delta 37), reused 0 (delta 0)
To ssh://myusername@myserver/home/myusername/gitReps/drupal-and-modules.git
   046640c..dc5c0c3  master -&gt; master
</code></pre>

<p>This updates the drupal-and-modules.git.</p>

<p>When drupal.git is updated, drupal-and-modules.git can be updated simply by using command</p>

<pre><code>git pull
</code></pre>

<p>Similarly we can maintain a third repository with all the localization and ready for production.</p>

<p>The implementation worked fine and the workflow should work in theory. However I&#8217;m pretty sure, it will be polished as I use git more and start using rebasing and stashing.</p>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2009/03/02/in-the-town-called-workflow-lived-three-friends-git-cvs-and-drupal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Git Configurations</title>
		<link>http://arvinderkang.com/2008/08/05/git-configurations/</link>
		<comments>http://arvinderkang.com/2008/08/05/git-configurations/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 21:08:24 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2008/08/05/git-configurations/</guid>
		<description><![CDATA[I have started using Git over Subversion. Following is the list of my git configurations. Globally ignore .DS/_Store echo ".DS_Store" &#62;&#62; ~/.gitignore git config --global core.excludesfile ~/.gitignore Information about me and my email goes here. git config --global user.name "My &#8230; <a href="http://arvinderkang.com/2008/08/05/git-configurations/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have started using <a href="http://git.or.cz/" title="Git - Fast Version Control System">Git</a> over <a href="http://subversion.tigris.org/" title="subversion.tigris.org">Subversion</a>. Following is the list of my git configurations.</p>

<p><span id="more-101"></span>
Globally ignore <a href="http://en.wikipedia.org/wiki/.DS_Store" title=".DS_Store - Wikipedia, the free encyclopedia">.DS/_Store</a></p>

<pre><code>echo ".DS_Store" &gt;&gt; ~/.gitignore
git config --global core.excludesfile ~/.gitignore
</code></pre>

<p>Information about me and my email goes here.</p>

<pre><code>git config --global user.name "My name"
git config --global user.email me@olemiss.edu
</code></pre>

<p>I love colors</p>

<pre><code>git config --global color.branch auto
git config --global color.diff auto
git config --global color.interactive auto
git config --global color.status auto
</code></pre>

<p>And I love <a href="http://macromates.com/" title="TextMate — The Missing Editor for Mac OS X">TextMate</a></p>

<pre><code>git config --global core.editor "mate -w"
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2008/08/05/git-configurations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git remote pushing</title>
		<link>http://arvinderkang.com/2008/07/19/git-remote-pushing/</link>
		<comments>http://arvinderkang.com/2008/07/19/git-remote-pushing/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 05:09:27 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2008/07/20/git-remote-pushing/</guid>
		<description><![CDATA[For the last half an hour I have been playing with Git. Project I&#8217;m working on my laptop is version tracked by git. However what is the fun of using version control without a remote server. As soon as I &#8230; <a href="http://arvinderkang.com/2008/07/19/git-remote-pushing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For the last half an hour <a href="http://toolmantim.com/article/2007/12/5/setting_up_a_new_rails_app_with_git" title="Setting up a new Rails app with Git">I have been playing with Git</a>. Project I&#8217;m working on my laptop is version tracked by git. However <a href="http://www.oss-watch.ac.uk/resources/versioncontrol.xml" title="OSS Watch -  What is version control? Why is it important for due diligence?">what is the fun of using version control</a> without a remote server.</p>

<p>As soon as I pushed my project directory to my remote OS X Tiger server, I got the following error.</p>

<pre>
    bash: line 1: git-receive-pack: command not found
    fatal: The remote end hung up unexpectedly
</pre>

<p>Google <a href="http://www.bluestatic.org/blog/2007/08/01/git-public-push-ing/" title="Blue Static - Blue Static Development  &raquo; Blog Archive   &raquo; Git Public push-ing Woes Resolved">comes to rescue</a>.</p>

<pre>
    Many installations of sshd do not invoke your shell as the login shell when you directly run programs; what this means is that if your login shell is bash, only .bashrc is read and not .bash_profile. As a workaround, make sure .bashrc sets up $PATH so that you can run git-receive-pack program.
</pre>

<p>Running following two lines solved the problem.</p>

<pre><code>echo export PATH=/usr/local/bin:$PATH &gt;&gt; ~/.bashrc
source ~/.bashrc
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2008/07/19/git-remote-pushing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Git on Rails project</title>
		<link>http://arvinderkang.com/2008/07/18/using-git-on-rails-project/</link>
		<comments>http://arvinderkang.com/2008/07/18/using-git-on-rails-project/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 13:46:15 +0000</pubDate>
		<dc:creator>Arvinder Kang</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[Tiger]]></category>

		<guid isPermaLink="false">http://arvinderkang.com/2008/07/18/using-git-on-rails-project/</guid>
		<description><![CDATA[After watching Linus Torvalds speaking for Git, and the popularity of Github, I am giving git a try. I have been using Subversion for a while, so things moved pretty smoothly. Steps I took to install Git on OS X &#8230; <a href="http://arvinderkang.com/2008/07/18/using-git-on-rails-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After watching <a href="http://www.youtube.com/watch?v=4XpnKHJAok8" title="YouTube - Tech Talk: Linus Torvalds on git">Linus Torvalds speaking for Git</a>, and the popularity of <a href="http://github.com/" title="Secure Git hosting and collaborative development &mdash; GitHub">Github</a>, I am giving <a href="http://git.or.cz/" title="Git - Fast Version Control System">git</a> a try. I have been using <a href="http://subversion.tigris.org/" title="subversion.tigris.org">Subversion</a> for a while, so things moved pretty smoothly.</p>

<p><span id="more-77"></span></p>

<p>Steps I took to install Git on OS X Tiger server are as follows (<a href="http://larrytheliquid.com/2007/12/29/compiling-git-and-git-svn-on-osx-tiger/" title="larrytheliquid  &raquo; Blog Archive   &raquo; Compiling Git and git-svn on OSX Tiger">Thanks to LarrytheLiquid</a>):</p>

<pre><code>cd /usr/local/src
</code></pre>

<p>Next lets install an XML parser dependency, Git, and it’s man pages:</p>

<pre><code>curl -O http://surfnet.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz
tar xvzf expat-2.0.1.tar.gz
cd expat-2.0.1
./configure --prefix=/usr/local
make
sudo make install
cd..

curl -O http://kernel.org/pub/software/scm/git/git-1.5.3.7.tar.gz
tar xvzf git-1.5.3.7.tar.gz
cd git-1.5.3.7
./configure --prefix=/usr/local
make
sudo make install
cd ..

curl -O http://www.kernel.org/pub/software/scm/git/git-manpages-1.5.3.7.tar.bz2
sudo tar xjv -C /usr/local/man -f git-manpages-1.5.3.7.tar.bz2
</code></pre>

<p>Add the following environment variable to whatever file your shell uses (.bash_profile for BASH):</p>

<pre><code>export MANPATH="/usr/local/man:$MANPATH"
</code></pre>

<p>One last line to add</p>

<pre><code>export PATH="/usr/local/bin:$PATH"
</code></pre>

<p>Git Installed. Check installed version.</p>

<pre><code>git --version
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://arvinderkang.com/2008/07/18/using-git-on-rails-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->