Description
Bug description
Creating a README file via the GitBook UI editor leads to serious issues in GitBook-integrated GitHub repositories, including:
- Repo-breaking behavior
- Duplicate README files
- Confusion around which file takes rendering precedence
- Loss of documentation with overwrites
Although this is referenced in GitBook documentation, the consequences are not clearly communicated, and the UI still allows users to create a README, which can have destructive effects.
This often results in broken builds, rendering conflicts, or overwritten content — especially for contributors working in hybrid GitHub + GitBook workflows.
Screenshot of an attempted removal of a duplicate README.md. To fully resolve the conflict, the GitBook space had to be hard reset to remove duplicated instances.
How to reproduce
- Open a space in the GitBook UI (within the app, not within the repo)
- Click “Add file”
- Name it README, Readme, or readme
Expected: The UI prevents or warns users from creating a reserved file like README.md when Git sync is enabled.
Actual: The UI allows it without warning, resulting in potential duplication, rendering issues, or overwriting of an existing GitHub README.md.
Additional context
- This is a common pitfall in GitHub-synced projects
- Mentioned vaguely in GitBook Git Sync Configuration
This states:
-
readme: Your documentation’s first page. Its default value is ./README.md
-
The default behavior treats README.md as special. Allowing users to create an additional README from the UI risks unexpected overrides or UI instability.
Could be avoided by:
- Disabling README file creation in the UI
- Displaying a tooltip/warning: “Creating a README here may overwrite your GitHub README.md and break repo integration.”