0

At first, I used the command below to generate my README file

usethis::use_readme_rmd().

After modifying the README.Rmd file, I tried pushing it to GitHub and receive this message within the Git Commit panel, which prevented the process to happen.

enter image description here

I googled the problem and there was one that suggested me running the code below to resolve the problem.

file.remove(".git/hooks/pre-commit")

I ran this code in the console and re-pushed again, and it worked! But my README file just didn't appear in the right format as I expected. Instead of the "nice landing page", my README on GitHub just appeared as an "original" Rmarkdown file with all the plain codes. And now I have no ideas..!

Could you please explain what the above message means and what should I do to avoid it in order to push the README?

NganKD
  • 71
  • 6
  • You wrote *"my README on GitHub just appeared as an "original" Rmarkdown "* -(Rmarkdown = .Rmd) but in the message from the commit panel it says "README.md" (markdown = .md). -> github won't know how to render a **.Rmd** file. Please confirm what markup language you used for the file: .Rmd or .md? Secondly, just to be 100% clear, you upload the README.md to the root directory of the repo and when you go to the landing page for the repo it shows the source code of the README.md (instead of its rendered content)? – dario Oct 09 '21 at 10:30
  • @dario I only create an .Rmd file using the `use_readme_rmd()` . So you say that I need to create another README file with .md extension in order for GitHub to render? – NganKD Oct 09 '21 at 12:48
  • Why don't you try it out and report back? Also I highly suggest consulting the help and documentation for the functions you are using (i.e. `?use_readme_rmd` and [https://usethis.r-lib.org/reference/use_readme_rmd.html](https://usethis.r-lib.org/reference/use_readme_rmd.html). – dario Oct 09 '21 at 12:54
  • I just did and it worked. Ahh,I think I kinda know what's going on now. Thank you @dario , it really helps! :) – NganKD Oct 09 '21 at 13:04

0 Answers0