Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Blobs

Nick Kallen edited this page · 2 revisions
Clone this wiki locally

Get a blob

Since blobs can be any arbitrary binary data, the input and responses for the blob API is returned encoded. Currently all data is base64 encoded, but for future compatibility, please use the encoding field when decoding data. Note that the media type application/vnd.gitdb.raw is also supported for blobs.

GET /repos/:repo/blobs/:sha
Response
{
  "name": "README.md",
  "path": "README.md",
  "type": "blob",
  "filemode": 33188,
  "commit_relative_url": "/repos/gitdb/commits/38f8d228f43f53bc42a77d5821aece4f09e66ca7/tree/README.md",
  "url": "/repos/gitdb/blobs/5c5ac45d9513562cc96e8e7021a8064009451ed8",
  "blob": {
    "filemode": 33188,
    "encoding": "base64",
    "size": 1276,
    "content": "KipHaXREQioqI...",
    "sha": "5c5ac45d9513562cc96e8e7021a8064009451ed8",
    "url": "/repos/gitdb/blobs/5c5ac45d9513562cc96e8e7021a8064009451ed8"
  },
  "commit": {
    "sha": "38f8d228f43f53bc42a77d5821aece4f09e66ca7",
    "message": "Better web navigation\n",
    "author": {
      "date": "2013-08-20T15:54:42.000Z",
      "name": "Nick Kallen",
      "email": "socialmediamaster9000@gmail.com"
    },
    "committer": {
      "date": "2013-08-20T15:54:42.000Z",
      "name": "Nick Kallen",
      "email": "socialmediamaster9000@gmail.com"
    },
    "tree": {
      "sha": "93fb384f1f8bfac23a2fbef7f4c40a345a0fd312"
    },
    "parents": [
      {
        "sha": "a3ba5a6e314ed63571e01677463164cb7a8a1e9b",
        "url": "/repos/gitdb/commits/a3ba5a6e314ed63571e01677463164cb7a8a1e9b"
      }
    ],
    "url": "/repos/gitdb/commits/38f8d228f43f53bc42a77d5821aece4f09e66ca7",
    "tree_url": "/repos/gitdb/commits/38f8d228f43f53bc42a77d5821aece4f09e66ca7/tree/",
    "repo": {
      "url": "/repos/gitdb",
      "refs_url": "/repos/gitdb/refs"
    }
  },
  "repo": {
    "url": "/repos/gitdb",
    "refs_url": "/repos/gitdb/refs"
  }
}
Something went wrong with that request. Please try again.