Monday, December 16, 2013

Working on an SVN branch with git svn


Usually, I use git for most of my projects. However, one of my projects is hosted on SVN.

I really don't have anything against svn but I found it to be very slow and limited in functionality. So, I decided to look out for some way to continue using git on this project as well.

Luckily, I found git svn

git svn allows the developers to continue using git on their machines even if the actual remote repository is hosted on SVN.


Use Case: 

I need to work on a SVN branch named 'my_project_v1.23' which has svn url as 
"http://svn.mycompany.com/repos/my_project/branches/my_project_v1.23"


git config --add svn-remote.my_project_v1.23.url http://svn.mycompany.com/repos/my_project/branches/my_project_v1.23
git config --add svn-remote.my_project_v1.23.fetch :refs/remotes/my_project_v1.23
git svn fetch my_project_v1.23 
git checkout -b local_my_project_v1.23 -t my_project_v1.23
git svn rebase my_project_v1.23

Hope this helps


Wednesday, July 24, 2013

git checkout a remote branch




git checkout --track -b 
  <local branch> <remote>/<tracked branch>



    git checkout --track -b haml origin/haml


http://gitready.com/intermediate/2009/01/09/checkout-remote-tracked-branch.html

Thursday, June 27, 2013

About me and my blog

A collection of google searches that I made for my day to day work.

About Me:

I am a Web Application Developer with specialization in J2EE based applications.  Most of my googled wisdom is likely to contain these keywords :

Groovy, Grails, Hibernate, Java etc.

MongoDB low level querying through grails mongodb plugin


This example displays MongoDB querying on multiple fields with multiple filters on any given field using grails MongoDB Plugin

Fetch all the people who have their lastName as "spencer" but their firstName must not be 'Mark' with salary between 10000 and 30000.

Person.collection.find('lastName':'Spencer',firstName: ['$ne':'Mark'], salary: ['$gt':10000, '$lt':30000])

Note:

We need to use single quotes while writing $gt, $ne, $lt etc because if we use double quote then grails tries to evalue $gt and hence results in error