Predictive Hacks

What is the tree-ish in Git

A tree-ish is a directory that contains files and subdirectories. In other words, a tree-ish can be a directory, a commit or a reference. For example:

  • SHA-1 hash
    • Example: git show <SHA>
  • HEAD
    • Example: git show HEAD
  • Branch
  • Tag
  • Ancestry
    • Example: git show HEAD^

List a tree-ish object

We can list a tree-ish object using the ls-tree command. For example:

git ls-tree HEAD
100644 blob 69caab2831763a8daca09ab0e09af36051308e98    README.md
100644 blob 148a5d09ed23ad803c5ba56df6d16c173a09a79d    myfile.txt

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

Python

Image Captioning with HuggingFace

Image captioning with AI is a fascinating application of artificial intelligence (AI) that involves generating textual descriptions for images automatically.

Python

Intro to Chatbots with HuggingFace

In this tutorial, we will show you how to use the Transformers library from HuggingFace to build chatbot pipelines. Let’s