use_github() error

I got the following error when I use use_github()

There are uncommitted changes and we're about to create and push to a new GitHub repo
Do you want to proceed anyway?

1: No way
2: Negative
3: Yup

Selection: 3
Error: This repo already has an 'origin' remote, with value 'GitHub - ManuelSpinola/crbiodiversity'.
You can remove this setting with:
usethis::use_git_remote("origin", url = NULL, overwrite = TRUE)

Are you trying to use it in the context of an Rstudio Project ?

(It seems like you already used it before, hence an original already present; do you want to scrap what you had before, and do this setup over again; or do you want to keep what you did, and add more commits to it ? if the latter, then you simply shouldnt use use_github, as that function is for setting up a relationship, not for pushing commits on a regular basis)

Its hard to advise you as you havent given any context, just that you used a function and got an error ....

Yes, I am trying to push uncommited changes, but i can’t push them, and update my github repo connected to a my RStudio project.

How can I do that?

Rstudio has git integration via the git pane near where the environment pane usually is.
Thats for interfacing with git for a project that has a configuration for git established.

Yes, I usually those tools, but right now are not working for me. I am sure I have something wrong in my settings, or I am doing something wrong.

These tools are greyed out.

I finally find the solution using:

git push --set-upstream -f origin main

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.