Package share on git from RStudio

I want to be able to host my R package on github. And want to be able to do it from within RStudio IDE. I am able to host files on git direct from RStudio. But, not able to pull/push "package" files. Followed this example here https://r-pkgs.org/git.html from R packages book by Hadley/Jenny, but still not able to push the package files to git. Help!

Here is what I've tried.

Hope some one can take a look... Again, I can push/pull to git for new projects. Tells me my git authentication is setup correctly.

"FIle -> New Directory -> New Project "

but NOT for R packages

"File -> New Directory -> R packages"

Here is what I try to push from terminal CLI

$ git remote add origin git@github.com:abiyug/pkg2.git
fatal: remote origin already exists.
$ git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
$

Ok, it was an authentication issue with github. I used ssh instead of http. In case someone else run into the same here are the steps I followed.

1/
Go to the .git directory

$cd ~packages/pkg2/.git

2/ remove the orig url (it was http)
$ git remote rm origin

3/ Add ssh URL

$ git remote add origin git@github.com:abiyug/pkg2.git

4/ Update ssh

$ cat ~/.ssh/id_rsa.pub
$ ssh -T git@github.com
Hi abiyug! You've successfully authenticated, but GitHub does not provide shell access.

5/ Now to synchronize with github
$ git push -u origin master

This topic was automatically closed 7 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.