{"id":20633186,"url":"https://github.com/publica-re/react-git-provider","last_synced_at":"2026-05-06T00:02:56.870Z","repository":{"id":143779794,"uuid":"282459676","full_name":"publica-re/react-git-provider","owner":"publica-re","description":"A Git provider for React","archived":false,"fork":false,"pushed_at":"2020-08-17T08:19:16.000Z","size":975,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T07:32:43.504Z","etag":null,"topics":["git","react"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/publica-re.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-25T14:25:30.000Z","updated_at":"2021-06-05T11:24:00.000Z","dependencies_parsed_at":"2023-05-17T08:46:24.857Z","dependency_job_id":null,"html_url":"https://github.com/publica-re/react-git-provider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/publica-re%2Freact-git-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/publica-re%2Freact-git-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/publica-re%2Freact-git-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/publica-re%2Freact-git-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/publica-re","download_url":"https://codeload.github.com/publica-re/react-git-provider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242633902,"owners_count":20161241,"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","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":["git","react"],"created_at":"2024-11-16T14:19:06.874Z","updated_at":"2026-05-06T00:02:51.825Z","avatar_url":"https://github.com/publica-re.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-git-provider\n\n\u003e A Git provider for React\n\nNote: this is a Work in progress !\n\n## Note\n\nThis is currently a proof of concept. I do not recommend using it in a production build.\n\nContributions are still welcome to ship it into the wild ! 🚀\n\n## Install\n\n```bash\nyarn add react-git-provider\n```\n\n## Usage\n\n### Basic usage\n\nYou can import this project, and then use it as a classic provider, which is described [https://react-git-provider.publica.re/interfaces/_types_.gitcontext.html](here).\n\nWe work with Promises, so don't forget your `await`s !\n\n### Use as a component\n\nIf you want your component to update automatically with changes (e.g. on commit, etc), we provide a `\u003cComponent /\u003e`, which you can extend and use anywhere inside a `\u003cProvider /\u003e`, which will be automagically triggered when changes occur.\n\nTo listen for changes, you have to set the `state.gitWatch` of your component with values corresponding with the value you want to watch first, and with the options matching first. For instance, if you want to watch for the current branch and the values of `test.tsx`, you have to write:\n\n```typescript\nthis.state = {\n  ...this.state,\n  gitWatch: {\n    branch: {\n      current: {},\n    },\n    file: {\n      read: { path: \"test.tsx\", mode: \"text\" },\n    },\n  },\n};\n```\n\nThen, in your render (or really anywhere), you'll be able to call\n\n```typescript\nthis.state.gitValues.branch.current;\n```\n\nto see the desired value.\n\n_Important_: if you want to overwrite the `componentDidMount`, `componentDidUpdate` or `componentWillUnmount`, you have to `super` them first!\n\n### Go futher\n\nYou can take a look at the source of [react-git-taskbar](https://github.com/publica-re/react-git-taskbar/) for an example or the [documentation](https://react-git-provider.publica.re) !\n\n## License\n\nCopyright 2020, [David Baumgartner](https://github.com/dvbmgr).\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n## Contributing\n\nI welcome happily contributions to pull request through [GitHub](https://github.com/publica-re/react-git-provider).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpublica-re%2Freact-git-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpublica-re%2Freact-git-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpublica-re%2Freact-git-provider/lists"}