{"id":15291248,"url":"https://github.com/azure/git-rest-api","last_synced_at":"2025-10-20T03:31:23.661Z","repository":{"id":35030640,"uuid":"186878615","full_name":"Azure/git-rest-api","owner":"Azure","description":"Service that adds a rest api on top a git repository","archived":false,"fork":false,"pushed_at":"2023-07-19T06:37:24.000Z","size":1813,"stargazers_count":16,"open_issues_count":11,"forks_count":8,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-10-14T00:09:54.832Z","etag":null,"topics":["api","docker","git","rest","service"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Azure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-15T18:02:49.000Z","updated_at":"2025-03-02T05:28:40.000Z","dependencies_parsed_at":"2023-02-13T23:05:17.005Z","dependency_job_id":null,"html_url":"https://github.com/Azure/git-rest-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Azure/git-rest-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgit-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgit-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgit-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgit-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Azure","download_url":"https://codeload.github.com/Azure/git-rest-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Azure%2Fgit-rest-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279997129,"owners_count":26256546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","docker","git","rest","service"],"created_at":"2024-09-30T16:11:38.520Z","updated_at":"2025-10-20T03:31:22.720Z","avatar_url":"https://github.com/Azure.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"| CI                                                                                                                                                                                                                   | CD                                                                                                                                                                                                                       |\r\n| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\r\n| [![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/tools/public.git-rest-api.ci?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=444\u0026branchName=master) | [![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/tools/Azure.git-rest-api%20Build?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=445\u0026branchName=master) |\r\n\r\n- Javascript SDK ![https://www.npmjs.com/package/git-rest-api-sdk](https://img.shields.io/npm/v/git-rest-api-sdk.svg)\r\n\r\n# Overview\r\n\r\nThis project is webserver that can be used as a docker container to provide a proxy/rest api on top of git repository.\r\nOne of the goal of this is to work around github api rate limiting. The api tries to looks as similar to the github rest api.\r\n\r\nFollowing apis are supported for now:\r\n\r\n- Commits\r\n  - List\r\n  - Get\r\n  - Compare\r\n- Branch\r\n  - List\r\n- Files\r\n  - List\r\n  - Get content\r\n\r\n# Quick start\r\n\r\n```\r\ndocker run -d -p 3009:3009 azuredevx/git-rest-api\r\nsleep 3 # optional: wait for container to start\r\ncurl localhost:3009/repos/github.com%2Foctocat%2FHello-World/contents/\r\n```\r\n\r\n# Deploy with docker\r\n\r\nImage: `azuredevx/git-rest-api`\r\n\r\nYou can configure various options using environemnt variables. See https://github.com/Azure/git-rest-api/blob/master/src/config/schema.ts\r\n\r\n**Note: There is no authentication layer yet from your service to the docker image. You should most likely use in in a contained environment(Inside a VNet or kubernetes cluster for example)**\r\n\r\n# Use the API\r\n\r\n* Using the Javascript sdk\r\nA javascript sdk is always included and up to date with the latest version of the service. \r\n\r\n```\r\nnpm install --save git-rest-api-sdk\r\n```\r\n\r\n* Use rest api\r\n\r\nThere is a `/swagger` endpoint which serve the swagger UI with all the api you can use and help you figure out the available/required params.\r\n\r\nTo authenticate against the repo if its not public you have 2 options:\r\n - `x-authorization`: This needs to be in a Basic auth format(`Basic base64(usename:password)`). Check with the git server how you can authenticate.\r\n - `x-github-token`: This is an helper for authnetication against github api. The basic header will be generated automatically \r\n\r\n# Develop\r\n\r\n1. Install dependencies\r\n\r\n```bash\r\nnpm install\r\n```\r\n\r\n2. Run\r\n\r\n```bash\r\nnpm start           # To run once\r\nnpm start:watch     # To run and restart when there is a change\r\n```\r\n\r\nRun in vscode\r\n\r\nInstead of `npm start` run `npm build:watch` and in vscode press `F5`\r\n\r\n# Windows\r\n\r\n- Long path issue. libgit2(library behind nodegit) doesn't support windows long path feature. Which means some repo with long reference might not work on windows. You can test with other simpler repos on windows. You should however not use this in production on windows.\r\n\r\n# Contributing\r\n\r\nThis project welcomes contributions and suggestions. Most contributions require you to agree to a\r\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\r\nthe rights to use your contribution. For details, visit https://cla.microsoft.com.\r\n\r\nWhen you submit a pull request, a CLA-bot will automatically determine whether you need to provide\r\na CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions\r\nprovided by the bot. You will only need to do this once across all repos using our CLA.\r\n\r\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\r\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\r\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fgit-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazure%2Fgit-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazure%2Fgit-rest-api/lists"}