Git Work Flow For Ruby on Rails Developers

This is my very first blog post and so I thought it should be about a tool that is indispensable for me - Git. I started using git about 10 months ago and looking back I can't imagine how I managed to get work done without it. The purpose of this post, however, is not to sing git's praises, there are lots of good articles on the web that do so much better than I ever could. Instead, I wish to share the work-flow I use on my projects. I developed this work-flow by trial and error over the months and is currently the most efficient and productive approach I can think of. If any experienced git users happen to stumble upon this post, please do provide suggestions/alternatives to help me improve my process.

The project I am currently working on requires me to maintain two parallel deployment branches. One is a "production branch" which is deployed on the live server and the other is a "development branch" which is deployed on a staging server. All enhancements and feature additions are done in the "development branch" and the only changes made in the "production branch" are production bug fixes that need urgent attention. Once the "development branch" is deemed stable it is merged into "production branch" and deployed.
Read more


Git Error: trailing whitespace, indent SP followed by a TAB, unresolved merge conflict

I have been using Git from last few days, and faced following errors while committing:

1) Trailing whitespace
2) Indent SP followed by a TAB
3) Unresolved merge conflict

The first error “Trailing whitespace” is because of carriage-return/line-feed(windows style line feed/end). To resolve this problem comment following lines(58-60) in .git/hooks/pre-commit file:

The second one “Indent SP followed by a TAB” is because of leading spaces/tabs. To resolve this problem comment following lines(61-63) in .git/hooks/pre-commit file:

The third one “Unresolved merge conflict” is because of seven or more successive occurrence of = or < or > characters. Major chances of having seven = character in README or doc files. To resolve this problem replace following line(64) in .git/hooks/pre-commit file:

by

These tricks worked for me, I hope it could help you.


Rails Plugin Annotate Models For Spec And Spec Fixtures

I have been using “Annotate Models” rails plugin written by Dave Thomas since I found it around one and half year ago. It really helps while writing fixtures. But if you use RSpec you might miss schema info at the top of your rspec fixture file as I do. So, today I modify the plugin file so that it prepends schema info to spec file and fixture file. Below are the links of patch file:

svn patch to add schema info to spec file and spec fixture file
git patch to add schema info to spec file and spec fixture file


Git - Fast Version Control System

Git is getting popular in Rails community these days, as there were being many changes in rails to support Git.
Git is a open sourse fast version controller system. It was originally designed by Linus Torvalds to handle large projects. It was inspired by Monotone & BitKeeper. It is a distributed version controlling system. It gives you ability to commit, traverse into history while being offline. Actually every working copy of Git is a full-fledged repository. It has no central server like SVN. One can share his working-copy/repository by using various protocols like ssh, http, ftp etc. One thing I like about Git over SVN is that the size of Git’s repository, which is smaller compared to SVN.

I gave an introductory presentation in VinSol. I am sharing it with you, this is not very explanatory as I focused on speech more. Please share your views. VinSol