Skip to content

Get a tree API works with tree objects or commit objects #25084

@theimpostor

Description

@theimpostor

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/rest/git/trees?apiVersion=2022-11-28#get-a-tree

What part(s) of the article would you like to see updated?

The description for the 'Get a tree' API says "Returns a single tree using the SHA1 value for that tree.". However, it seems that the SHA1 value can be either the tree OR a commit SHA1. It would be helpful to document that either value can be used. Other APIs return links to the get tree API (e.g. get submodule contents) that use the commit SHA1, not the actual git tree SHA1.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teamrestContent related to rest - overview.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions