4

Is there a way to retrieve all the SHA1's for all objects (blobs and trees) inside of a particular commit in git?

0

1 Answer 1

3

I'm pretty sure that git rev-list will do what you want:

git rev-list --no-walk <commit> --objects

See the documentation on git rev-list for more information at http://www.kernel.org/pub/software/scm/git/docs/git-rev-list.html.

Edit: Added --no-walk as per Paŭlo Ebermann's suggestion; this will only show the objects for the given ref, without the ancestor commits.

Sign up to request clarification or add additional context in comments.

2 Comments

I suppose you want git rev-list --no-walk <commit> --objects instead - it gives you only one commit, instead of a commit and all its parents.
That would be even better. ;]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.