I'm trying to set up readthedocs.org integration for a project that is on GitHub. The builds on RTD keep failing with this error: "Failed to checkout revision: master"
This is confusing because the repo in question has no master
branch -- it has a main
branch though, and RTD should default to main
for git repositories.
Here's the raw log:
[rtd-command-info] start-time: 2023-11-01T17:19:31.981021Z, end-time: 2023-11-01T17:19:32.374086Z, duration: 0, exit-code: 0
git clone --depth 1 https://github.com/atlanticwave-sdx/sdx-docs .
Cloning into '.'...
[rtd-command-info] start-time: 2023-11-01T17:19:32.394696Z, end-time: 2023-11-01T17:19:32.729551Z, duration: 0, exit-code: 0
git fetch origin --force --prune --prune-tags --depth 50
[rtd-command-info] start-time: 2023-11-01T17:19:32.809966Z, end-time: 2023-11-01T17:19:32.871692Z, duration: 0, exit-code: 1
git checkout --force master
error: pathspec 'master' did not match any file(s) known to git
I can't seem to change the default branch, because the dropdown under admin > advanced settings > default branch is empty.
Things that are probably worth noting:
- On GitHub, the "Read the Docs Community" application has been granted permission to the org under which I have the problem repository.
- On RTD, "Integration - GitHub incoming webhook" has been set up, and as far as I can see, there are no errors. I tried adding and removing this hook, and resyncing the webhook, but that made no difference.
Why does RTD attemp to check out a non-existent master
branch when there's a main
branch? Can I change this behavior, and how?
I no longer have this problem. I reached out to RTD support, and they solved this for me.