Tuesday, November 15, 2011

How to see contents of objects in git

Following command shows the content of and object in git
git show <sha1 of object>

The sha1 of the object can be found in directory .git/object/[a-z0-9][a-z0-9]/[a-z0-9]{38}. Note that while create subdirectories in objects folder git takes the first 2 letters to create a sub-directory and remaing 38 to name the file that contains the content. In the command above you will have to give full 40 characters 

No comments:

Post a Comment