0

I have a tree of commit found by SHA-1,code is: tree = repo.tree(sha) now I need to find blob by file name and display its content

Kazimír
  • 31
  • 2

1 Answers1

1

given the SHA1 of the commit itself, you would:

git show SHA1:path/to/your/file.txt

if you know the sha1 of the blob itself, you can

git cat-file blob SHA1
user229044
  • 232,980
  • 40
  • 330
  • 338
Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141