Cannot push to github on an already created repository

I'm trying to have a blog using blogdown, on my Windows 10 machine.

I've already an empty repository called : 'omargonzalesdiaz' (no readme file) on Github.

I've created a blog using blogdown that I want to publish to Github, so later I can use netlify.

But I get this error:

cred <- git2r::cred_ssh_key(
+     publickey = "~/../.ssh/",
+     privatekey = "~/../.ssh/id_rsa"
+ )
> usethis::use_github(credentials = cred)
✔ Checking that current branch is 'master'
Error: Repo 'OmarGonD/omargonzalesdiaz' already exists on ''.

Infomation about my configuration


> usethis::git_sitrep()
Git user
* Name: 'OmarGonD'
* Email: ''
* Vaccinated: TRUE
usethis + git2r
* Default usethis protocol: <unset>
* git2r supports SSH: TRUE
* Credentials: '<usethis + git2r default behaviour>'
* Personal access token: '<found in env var>'
* User: 'OmarGonD'
* Name: 'omar'
* Path: 'D:/omargonzalesdiaz/.git'
* Local branch -> remote tracking branch: 'master' -> '<unset>'
GitHub pull request readiness
* origin: OmarGonD/omargonzalesdiaz, can push
* upstream: '<no such remote>'

Environ file:

Entered and save when cursor was in a new line, as documentation said.



While I've never used usethis::use_github() :grinning:, my impression from the documentation is that the function is supposed to create a GitHub repository for you. Given that, it seems possible that already having a repo with the same name could be problematic and the cause of the error message.

Have you tried deleting the empty repo you made on GitHub and letting use_github() make it instead?


Yes, I think the same. 2 Questions:

a) Can I delete my repository and create other with the same name?
b) Maybe someone can point us on how to use this library on already created repositories?

This topic was automatically closed 21 days after the last reply. 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.