如何修复我的 Netlify 站点的 'sha' 未定义错误?

How can I fix the 'sha' undefined error for my Netlify site?

所以我建立了一个主题为 [Moon] 的 Jekyll 网站(未能持久化条目:TypeError:无法读取 属性 'sha' of undefined)并将其上传到我的GitHub repository. Then I want to add Netlify's admin panel to my site so I follow this guide 其中我将config.yml修改为如下代码:

backend:
  name: git-gateway

publish_mode: editorial_workflow

media_folder: "files"

display_url: https://ccsource.org

slug:
  encoding: "ascii"
  clean_accents: true

collections:
  - name: "story"
    label: "Story"
    folder: "_posts"
    extension: "md"
    slug: "{{year}}-{{month}}-{{day}}-{{slug}}"
    create: true
    fields:
      - {label: "Layout", name: "layout", widget: "hidden", default: "post"}
      - {label: "Title", name: "title", widget: "string"}
      - label: "tags"
        name: "tags"
        widget: "list"
        allow_add: true
        default: ["story"]
      - {label: "Summary", name: "excerpt", widget: "string", required: false}
      - {label: "comments", name: "comments", widget: "hidden", default: true}
      - label: "Publish date"
        name: "date"
        widget: "datetime"
        default: ""
        format: "MMM Do YY"
      - {label: "Body", name: "body", widget: "markdown", required: true}

因为我得到了像这样的降价示例文件:

---
layout: post
title:  "Sample"
date:   2016-03-15
excerpt: "Hello..."
tag:
- sample
- post
- video
comments: true
---
# Sample

但是在所有设置和部署之后,我访问了我网站的管理面板并尝试创建一个新的 post 我不断收到以下错误。

Failed to persist entry: TypeError: Cannot read property 'sha' of undefined

我用谷歌搜索并将 branch 值修改为 site,这与我的 github 存储库匹配,但错误一直显示,我该如何解决?

对于遇到此问题的任何其他人,问题是 Netlify Identity 已启用,但 Netlify Identity 的子功能 Git Gateway 未启用。在此处启用 Git 网关的说明:https://www.netlify.com/docs/git-gateway/#getting-started