Back to index
Git never ceases to amaze me!

At work, we use Subversion for version control. SVN is really good - but it disturbs my workflow which is 'Commit Early, Commit Often'. People create builds three or four times a day for testing and obviously they don't want my Work In Progress commits in that. They expect me to commit only after a feature is completely done. That was handicapping my pace of development.

So, the solution - Enter git-svn :D

git-svn allows me to checkout a subversion repo as a git repository. Since my working copy is a git repo now, I get all the fantastic features of git. At the start, I was using git in a very minimal way - make commits locally, created local branches and seamlessly switched between them. Even that helped greatly to my development pace.

As days pass by, I keep on discovering lot of gems in git - which make me like,

"Holy F, How did I exist without this these many days??" :P

Discovering git squash is one such incident. git bisect was another one. Today is one such day.

At work we use Target Process for project management. Issues, Requests, Feedbacks, Usecases everything is created in TargetProcess and we use the related Id in our commits. We don't commit anything to SVN without mentioning TargetProcess artifact Id.

There is a new feature which came as a request through email - and I have started development on it - made a few commits to my git repo. That feature was not yet added to the TP, so I can't push it to the SVN repo. While this was being done, another important bug fix came and I had to fix it immediatly and push it to the SVN repo. Now the unfinished feature's commits are there and on top of it there is this urgent bug fix commit. I need to push only the bug fix commit to the SVN repo without pushing any of the new feature's commit. I could've done the development of the new feature in a local branch - keeping the master clean. But that is not a option now. Damage is done. What I did is this:

  • I converted both the bugfix and new feature changes into git-am patches.
  • Deleted both the commits and made the master as clean slate.
  • Applied only the bug fix commit.
  • Moved the other feature commits to a separate branch.
  • Pushed to bug fix to the SVN.
  • Be happy!

I know this is trivial. May be some other better way could be there. But, the power and flexibility of git just made me fall in love with it all over again :D git never ceases to amaze me!

Published at : Thursday Mar,28 2013 at 00:20 | Tags : hacking, git, Subversion, svn, | Comments
blog comments powered by Disqus Browse Archives
I am..
Azhagu Selvan SP
Atheist, FOSS enthusiast,
Pythonist, Student
Creative Commons License