| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8fbf17d commit c3932d2
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,14 @@ | |||
| 1 | + --- | ||
| 2 | + title: Commit Reference SHA-1 API is now official | ||
| 3 | + author_name: mikemcquaid | ||
| 4 | + --- | ||
| 5 | + | ||
| 6 | + We're making the [Commit Reference SHA-1 API][api-enhancements-blog-post] part of the official GitHub API. | ||
| 7 | + | ||
| 8 | + During the preview period you needed to provide the `application/vnd.github.chitauri-preview+sha` preview media type in the `Accept` header to opt-in to the changes. Now that the preview period has ended the custom [media type][custom-media-types] has changed to `application/vnd.github.v3.sha` (but the preview type will continue to work). | ||
| 9 | + | ||
| 10 | + If you have any questions or feedback, please [get in touch with us][contact]! | ||
| 11 | + | ||
| 12 | + [api-enhancements-blog-post]: /changes/2016-02-24-commit-reference-sha-api/ | ||
| 13 | + [custom-media-types]: /v3/media/ | ||
| 14 | + [contact]: https://github.com/contact?form[subject]=Commit+Reference+SHA-1+API | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -125,6 +125,10 @@ The Commit, Commit Comparison, and Pull Request resources support | |||
| 125 | 125 | ||
| 126 | 126 | application/vnd.github.VERSION.patch | |
| 127 | 127 | ||
| 128 | + ### sha | ||
| 129 | + | ||
| 130 | + application/vnd.github.VERSION.sha | ||
| 131 | + | ||
| 128 | 132 | ## Repository contents | |
| 129 | 133 | ||
| 130 | 134 | ### Raw | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,24 +45,14 @@ patch formats. | |||
| 45 | 45 | ||
| 46 | 46 | ## Get the SHA-1 of a commit reference | |
| 47 | 47 | ||
| 48 | - {{#tip}} | ||
| 49 | - | ||
| 50 | - <a name="preview-period"></a> | ||
| 51 | - | ||
| 52 | - The API to get the SHA-1 of a commit reference is currently available for developers to preview. | ||
| 53 | - During the preview period, the API may change without advance notice. | ||
| 54 | - Please see the [blog post](/changes/2016-02-24-commit-reference-sha-api) for full details. | ||
| 55 | - | ||
| 56 | - To access the API you must provide a custom [media type](/v3/media) in the `Accept` header: | ||
| 57 | - | ||
| 58 | - application/vnd.github.chitauri-preview+sha | ||
| 59 | - | ||
| 60 | - {{/tip}} | ||
| 61 | - | ||
| 62 | 48 | Users with read access can get the SHA-1 of a commit reference: | |
| 63 | 49 | ||
| 64 | 50 | GET /repos/:owner/:repo/commits/:ref | |
| 65 | 51 | ||
| 52 | + To access the API you must provide a custom [media type](/v3/media) in the `Accept` header: | ||
| 53 | + | ||
| 54 | + application/vnd.github.VERSION.sha | ||
| 55 | + | ||
| 66 | 56 | To check if a remote reference's SHA-1 is the same as your local reference's SHA-1, make a `GET` request and provide the current SHA-1 for the local reference as the ETag. | |
| 67 | 57 | ||
| 68 | 58 | ### Response | |
| Back | FazBrowse Home | New Git URL |
0 commit comments