Tina Docs
Home
Blog
Showcase
Community
Introduction
Overview
Introduction To TinaCMS
Getting Started
Using the Tina Editor
FAQ
Core Concepts
Content Modeling
Data Fetching
Visual Editing
Querying Content
Overview
Writing custom queries
Editing
Overview
Markdown & MDX
Block-based editing
Single Document Collections
Customizing Tina
Overview
Validation
Custom Field Components
Custom List Rendering
Format and Parse Input
Filename Customization
Before Submit function
Going To Production
Overview
Tina Cloud
Self-Hosted
Drafts
Overview
Draft Fields
Editorial Workflow
Guides
Overview
Framework Guides
Separate Content Repo
Querying Tina Content at Runtime
Internationalization
Migrating From Forestry
Further Reference
Overview
Config
Schema
The "tina" folder
The TinaCMS CLI
Media
Search
Content API
Tina's edit state
The "tinaField" helper
Self-Hosted Components
Overview
Backend Host
Git Provider
Overview
GitHub
Bring Your Own Git Provider
Database Adapter
Auth Provider

The GitHub Git Provider handles saving and deleting content to a GitHub hosted Git repository. It is configured as a parameter to the createDatabase function.

Looking for the code? Check out the GitHub repository.

Adding the GitHub Git Provider

import { GitHubProvider } from 'tinacms-gitprovider-github'
// database.{ts,js}
//...
export default isLocal ? createLocalDatabase() ? createDatabase({
gitProvider: new GitHubProvider({
branch: process.env.GITHUB_BRANCH,
owner: process.env.GITHUB_OWNER,
repo: process.env.GITHUB_REPO,
token: process.env.GITHUB_PERSONAL_ACCESS_TOKEN,
}),
// ...
})

GitHub Git Provider Options

Required Parameters

OptionDescription
branchThe branch to save content to.
ownerThe owner of the repo.
repoThe repo to save content to.
tokenA Github Personal Access Token.

Optional Parameters

OptionDescription
commitMessageThe commit message to use when saving content. Defaults to Edited with TinaCMS.
rootPathThis path will be prefixed to all paths. Usually only used in monorepos. Optional.
octokitOptionsOptions passed to the Octokit constructor

Product

Showcase
TinaCloud
Introduction
How Tina Works
Roadmap

Resources

Blog
Examples
Support
Media

Whats New
TinaCMS
TinaCloud
Use Cases
Agencies
Documentation
Teams
Jamstack CMS
Benefits
MDX
Markdown
Git
Editorial Workflow
Customization
SEO
Comparisons
TinaCMS vs Storyblok
TinaCMS vs Sanity
TinaCMS vs DecapCMS
TinaCMS vs Contentful
TinaCMS vs Builder.io
TinaCMS vs Strapi
Integrations
Astro
Hugo
NextJS
Jekyll