Netlify-cms: Failed to persist entry: API_ERROR: Branch not found

Created on 9 Nov 2020  路  8Comments  路  Source: netlify/netlify-cms

netlify-help
I recently start a blog using gatsby starter. The problem i'm facing right now is, whenever i post a blog via netlify CMS it shows Failed to persist entry: API_ERROR: Branch not found need help on this.

bug

All 8 comments

Is your repo part of an organization? In that case you might have to approve your app: https://help.github.com/en/articles/requesting-organization-approval-for-oauth-apps

I too have encountered this issue. I even re-did the gatsby tutorial, remade all repos and acces tokens, but it still throws this error.

I'll update if I find the solution.

I too was facing the same issue and currently facing but i tried to figure it out.
My website is hosted on Netlify so i went to the netlify initial url that is rahulism.netlify.app/admin and i have accessed it but when i go to rahulism.co/admin i face the same error. We'll this is just a small work, working for me.

I changed

backend:
  name: github
  repo: your-username/your-repo-name

to

backend:
  name: git-gateway
  branch: main

And it's working. Look at your repo branch and compare it to the branch in your config.yml.

In config.yml file, specify your main branch name (mainor masteror any other name) in the backend like below and it should work

backend:
  name: github
  repo: username/repo-name
  branch: branch-name

Thanks MoHassn. My branch name is main, adding in that 'branch:main' fixed the problem. I did not have to switch the name from github to git-gateway.

branch: main

This solution worked for me. Adding branch fixed the issue.

Closing this issue resolved. Thanks everyone

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zebapy picture zebapy  路  3Comments

marcojakob picture marcojakob  路  3Comments

chriskirknielsen picture chriskirknielsen  路  3Comments

dur41d picture dur41d  路  3Comments

ciokan picture ciokan  路  3Comments