usethis::use_pkgdown_github_pages() error

I ma developin a package and I not the following error using the function usethis::use_pkgdown_github_pages()

usethis::use_pkgdown_github_pages()
Error in stop_bad_github_remote_config():
! Unsupported GitHub remote configuration: 'no_github'
• Host = NA
• origin =
• upstream =
• Neither 'origin' nor 'upstream' is a GitHub repo.

Read more about the GitHub remote configurations that usethis supports at:
'Chapter 25 Common remote setups | Happy Git and GitHub for the useR'
Run rlang::last_trace() to see where the error occurred.

Yes, as the error says, usethis::use_pkgdown_github_pages() requires that the package is on GitHub, i.e. git remote -v should show something like:

❯ git remote -v
origin	https://github.com/<user>/<repo> (fetch)
origin	https://github.com/<user>/<repo> (push)

Thank you Gabor.

How can I get the right setting or connect my package to my existing github repository.

I have another package that works fine and this is what I get when I do:

git remote -v
origin git@github.com:ManuelSpinola/crgrids.git (fetch)
origin git@github.com:ManuelSpinola/crgrids.git (push)

Use git remote add origin <URL>.

usethis is best with https:// URLs, and not great with the ssh URLs you have. See here: About remote repositories - GitHub Docs and here: Managing Git(Hub) Credentials • usethis

I did that

git remote -v
origin GitHub - ManuelSpinola/crbiodiversity (fetch)
origin GitHub - ManuelSpinola/crbiodiversity (push)
upstream GitHub - ManuelSpinola/crbiodiversity (fetch)
upstream GitHub - ManuelSpinola/crbiodiversity (push)

but I still got the same error message:

use_pkgdown_github_pages()
:heavy_check_mark: Setting active project to '/Users/manuelspinola/Documents/R/R_packages/crbiodiversity'
Error in stop_bad_github_remote_config():
! Unsupported GitHub remote configuration: 'no_github'
• Host = NA
• origin =
• upstream =
• Neither 'origin' nor 'upstream' is a GitHub repo.

Read more about the GitHub remote configurations that usethis supports at:
'Chapter 25 Common remote setups | Happy Git and GitHub for the useR'
Run rlang::last_trace() to see where the error occurred.

What's the output of

gert::git_remote_list()

right after the usethis failure? If that does look right, then I would open an issue in the usethis repository.

gert::git_remote_list()
# A tibble: 0 × 2
# ℹ 2 variables: name <chr>, url <chr>

I need to add that my package debvelopment crash when I used deploy_to_branch()

Deleted most of the files in my package project folder, and I rebuild the package again, may be in that process something was missing.

That means that git remote is not set up correctly. You have to call git remote add origin ... (again).

It says: "remote origin already exists."

git remote add origin GitHub - ManuelSpinola/crbiodiversity
error: remote origin already exists.

I also have gh-pages in my repository.

Are you sure that you are running git and R in the same working directory? Run

getwd()

in R and

pwd

in the shell to make sure.

getwd()
[1] "/Users/manuelspinola/Documents/R/R_packages/crbiodiversity"

pwd
/Users/manuelspinola/Library/Mobile Documents/com~apple~CloudDocs/.Trash/crbiodiversity 14.28.14

Something is wrong in my terminal.

I think everything is right now. Thank you very much Gabor.

use_pkgdown_github_pages()
Overwrite pre-existing file '_pkgdown.yml'?

1: I agree
2: Not now
3: No way

Selection: 1
:heavy_check_mark: Writing '_pkgdown.yml'
• Modify '_pkgdown.yml'
:heavy_check_mark: GitHub Pages is publishing from:
• URL: 'crbiodiversity'
• Branch: 'gh-pages'
• Path: '/'
:heavy_check_mark: Creating '.github/'
:heavy_check_mark: Adding '^\.github$' to '.Rbuildignore'
:heavy_check_mark: Adding '*.html' to '.github/.gitignore'
:heavy_check_mark: Creating '.github/workflows/'
:heavy_check_mark: Saving 'r-lib/actions/examples/pkgdown.yaml@v2' to '.github/workflows/pkgdown.yaml'
• Learn more at https://github.com/r-lib/actions/blob/v2/examples/README.md.
:heavy_check_mark: Recording 'crbiodiversity' as site's url in '_pkgdown.yml'
:heavy_check_mark: Adding 'crbiodiversity' to URL
:heavy_check_mark: Setting 'crbiodiversity' as homepage of GitHub repo 'ManuelSpinola/crbiodiversity'

1 Like

This topic was automatically closed after 45 days. New replies are no longer allowed.


If you have a query related to it or one of the replies, start a new topic and refer back with a link.