Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4044112
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:12:46+00:00 2026-05-20T13:12:46+00:00

I checked in one file into a simple git repo. From my investigations; there

  • 0

I checked in one file into a simple git repo.
From my investigations; there are three types of objects placed in .git/objects

  1. commit
  2. tree
  3. blob

As an example:

$ git cat-file -t 8b4e834eba22e60c284c7b77e43d3c29e619f92f
commit

$ git cat-file -t c7c5b03aea0b8c970c93de3670c28f2108948266
tree

$ git cat-file -t e965047ad7c57865823c7d992b1d046ea66edf78
blob

If I tried to run git-ls-tree on a blob, it throws an error.

But it is equally possible for me to run it on a commit or tree object.

$ git ls-tree -t c7c5b03aea0b8c970c93de3670c28f2108948266
100644 blob e965047ad7c57865823c7d992b1d046ea66edf78    readme.txt

$ git ls-tree -t 8b4e834eba22e60c284c7b77e43d3c29e619f92f
100644 blob e965047ad7c57865823c7d992b1d046ea66edf78    readme.txt

Is a commit object also a tree ?
What are their differences, if any ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:12:46+00:00Added an answer on May 20, 2026 at 1:12 pm

    A commit object is an object that references a tree and associates other metadata (author, committer, timestamps, etc) with it.

             Commit
           /        \
          /          \
    (parent SHA)     Tree
    (author)        /    \
    (committer)   Blob   Blob
    (timestamps)
    (etc)
    

    Multiple commit objects can reference the same tree (if the state of files in each commit is identical).

    For instance, if two people make the same change to a file and commit, it will result in two different commit objects (since both the timestamps and the authors will differ). However, since the end result is the same file contents, both commits will point to the same tree.

    When you run git ls-tree on a commit SHA, it automatically uses the tree SHA referenced by that commit instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I find it difficult to export classes from one project into JAR file, so
Hi I'm trying to migrate my HTML/PHP/JS/XML page into one php file. I was
i want to create one ssis package which takes values from flat file and
I have all my Eclipse Plug-Ins checked out in one Hudson workspace. For every
One of my co-workers checked in a some files in SVN and one of
In jQuery, how does one go about finding all the 'unchecked' checked boxes. $(':checkbox:checked');
I listen for 2 click events. First one fires when checkbox is checked: $('#example').on('click',
On a SQL Server 2005 database, one of our remote developers just checked in
I need this query - update last but one record. UPDATE changes SET checked=''
I checked out a project from SVN and did not specify the project type,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.