Saturday, June 9, 2007

Git it !!!

Banged my head a thousand times to figure out how Git actually works, last week.
For a developer coming from Subversion world that was not at all easy. Finally i must confess 90% of the people are unaware how actually git works.Why? Because they gave me all sorts of crazy ideas.
The very purpose of git is to be transparent and powerful. And i made full use of it. realised that there is no need to download 300MB of src from linus's repository to work on kernel src. And so i am happy now that i figured out a trivial but important cheat.

Cheat is you don't need to download the tag necessarily if you want to work on a local source tree and that includes any damn src in the world.
Just cd to the src tree and do following -

$ git add .
$ git commit
$ git tag -f v2.6.xyz-mine
$ git tag -l
$ git branch devel-branch v2.6.xyz-mine
$ git checkout devel-branch
$git branch
this shoule show a star in front of devel-branch.

Now modify the src, add files, remove some.
to commit
$ git diff
$ git add file_changed.c
$ git commit
or
$ git commit -a [to combine last two steps]

Hope this will help who want to migrate to git without downloading 300MBs of kernel src.

Godspeed.

--psr

No comments: