Sunday, June 15, 2008

Does it GIT any better than this?

Cool GIT feature of the moment:   Content based tracking of files.

I renamed a file in a project, and then did a 'git rm', and 'git add' to update the index and subsequently committed and pushed the changes.  Then, on the origin repo, I executed a 'git status' to see what changes were pending.  GIT displayed:

# renamed:    AllViewController.h -> RootViewController.h

# renamed:    AllViewController.m -> RootViewController.m


Huh?   It recognized that the content was renamed even though I had only communicated a 'delete' and 'add' operation for the file.   Apparently this is because GIT does sha-1 on all content -- allowing it to know when you move content around (even if you don't tell it).  Nice!



No comments: