tinacms/tinacms
public

Tinacms

A fully open-source headless CMS that supports Markdown and Visual Editing

rss

React hook that instantiates the deprecated GitFile class (PR #5715). Removed together with the legacy filesystem API.

411d until removal

deprecated June 9, 2025removal June 9, 2027
/**
 * @deprecated as the API is clunky and hard to use. Mutations should now be
 * done via Graphql. This will be removed by July 2025.
 */
export function useGitFile(
  relativePath: string,
  format: (file: any) => string,
  parse: (content: string) => any
) {
  const cms = useCMS();
  return useMemo(
    () => new GitFile(cms, relativePath, format, parse),
    [cms, relativePath, format, parse]
  );
}

Use the TinaCMS form/client hooks (e.g. useTina) and submit mutations through the GraphQL client.

  • JackDevAUJackDevAUadded packages/tinacms/src/toolkit/git-client/use-git-file.ts1h ago