---
title: "Git Tree"
url: "https://kiwi.arashsheyda.me/apis/git-hub-v3-rest-api-1/versions/4cb06d26-20a0-409c-8492-8406889b7eb4/schemas/git-tree"
---

> Full API specification: https://kiwi.arashsheyda.me/apis/git-hub-v3-rest-api-1/versions/4cb06d26-20a0-409c-8492-8406889b7eb4.md

# Git Tree

The hierarchy between files in a Git repository.

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: GitHub v3 REST API
  version: 1.1.4
servers:
  - url: "{protocol}://{hostname}/api/v3"
    variables:
      hostname:
        description: Self-hosted Enterprise Server or Enterprise Cloud hostname
        default: HOSTNAME
      protocol:
        description: Self-hosted Enterprise Server or Enterprise Cloud protocol
        default: http
components:
  schemas:
    git-tree:
      title: Git Tree
      description: The hierarchy between files in a Git repository.
      type: object
      properties:
        sha:
          type: string
        url:
          type: string
          format: uri
        truncated:
          type: boolean
        tree:
          description: Objects specifying a tree structure
          type: array
          items:
            type: object
            properties:
              path:
                type: string
                example: test/file.rb
              mode:
                type: string
                example: "040000"
              type:
                type: string
                example: tree
              sha:
                type: string
                example: 23f6827669e43831def8a7ad935069c8bd418261
              size:
                type: integer
                example: 12
              url:
                type: string
                example: https://api.github.com/repos/owner-482f3203ecf01f67e9deb18e/BBB_Private_Repo/git/blobs/23f6827669e43831def8a7ad935069c8bd418261
          example:
            - path: file.rb
              mode: "100644"
              type: blob
              size: 30
              sha: 44b4fc6d56897b048c772eb4087f854f46256132
              url: https://api.github.com/repos/octocat/Hello-World/git/blobs/44b4fc6d56897b048c772eb4087f854f46256132
              properties:
                path:
                  type: string
                mode:
                  type: string
                type:
                  type: string
                size:
                  type: integer
                sha:
                  type: string
                url:
                  type: string
              required:
                - path
                - mode
                - type
                - sha
                - url
                - size
      required:
        - sha
        - url
        - tree
        - truncated
```
