This is because github_document offers a preview mode by creating an html file in addition to the md file. This will overwrite your other html file with the same name. And by default, keep_html is FALSE and that means the html file used for preview is removed from the working dir.
See doc:
This means you can for now:
- either set
html_preview = FALSE so that no HTML is generated for preview
- either set
keep_html = TRUE so that the html file used for preview is kept in the working directory
Note that the HTML file generated is aimed at providing a preview like Github rendering - so it is different than html_document rendering.
So currently, unless html_preview = FALSE, you can't have another html file with the same name in your working dir.
If you want to have another workflow, like not having an html file that is the GIthub preview but a html_document format with the same output name, you should open an issue in rmarkdown github repo to explain your case and we thought on a workaround.
Hope it helps understand.