2

Trying to connect GitHub account to RStudio cloud but when I try to commit a test script, even though I've told Git who I am, RStudio cloud still gives an error saying it doesn't know which email/username to use. Most information about how to connect them is specific to the downloaded version of RStudio, but I unfortunately need to use RStudio cloud.

Steps I took:

  1. Download Git, make github account, create new repository called "testing"
  2. Configure git using git bash with: git config --global user.email "you@example.com" git config --global user.name "your name"
  3. Open a new project in Rstudio cloud (new project> new project from git repository), using link from repository called "testing"
  4. Set up Git in RStudio (tools>global options>git/SVN). I wasn't sure what file path to put for the exe. Here's what I tried: a. Leaving it as default (default is "/usr/bin/git") b. linking it to the physical location of the exe on my computer (in my downloads) c. uploading the exe to my cloud project folder, then putting that link in the box All produced the same error (see below)
  5. Create and copy SSH key to github repository "testing"
  6. Create dummy script
  7. Save (appears in the cloud folder)
  8. Stage the dummy script and click commit in the git tab of the environment window
  9. New window opens--top right has the option to put in a commit message. Tried with and without text there.
  10. Press commit
  11. Popup named "Git commit" says "Please tell me who you are. Run git config --global user.email "you@example.com"; git config--global user.name "your name" to set your account's default identity. Omit --global to set the identity only in this repository. Fatal: unable to auto-detect email address (got 'r1487703@application-7788368-deployment-16293362-lqv6m.(none)')

I tried putting those commands into the console just in case but it says "unexpected symbol in "git config"".

I also looked at this github post: and tried their suggestions but no dice. (ie "git remote -vv" just returns "unexpected symbol in "git remote"")

Thank you for any time you spend, I am extremely new to all programming and trying to learn through a course that is requiring me to do this.

kswp
  • 35
  • 3
  • 1
    I hope this helps somehow, I followed this tutorial to connect my git to R: https://happygitwithr.com/rstudio-git-github.html#rstudio-git-github , maybe there's sth there... – Larissa Cury Dec 01 '22 at 23:06
  • Can you cut and paste the exact command you ran with the exact error message you got in a code block, so we can see it exactly as it happens in your console? Start a code block with three backticks on their own on a line, and end it the same way. – joanis Dec 02 '22 at 00:18
  • Hum, the error message `unexpected symbol in` does not exist anywhere in the Git source code. I wonder if it's a message from your shell instead. What shell are your using, and what platform are you running on? – joanis Dec 02 '22 at 00:24
  • 1
    Actually, Google tells me that message is likely from R itself. You need to run the Git commands in the regular console with a regular shell prompt, not at the R prompt. – joanis Dec 02 '22 at 00:27
  • I am running the "git remote -vv" command in the R studio cloud console. I'm not sure what you mean by "regular console" or "regular shell prompt". I'm sorry, I'm very, very new – kswp Dec 05 '22 at 16:49

1 Answers1

1

You can see a similar case in this issue

  1. In the RStudio Terminal (not the Console but the tab next to it --- the prompt should have a $ and not >), type

    $ git config --list --show-origin
    

    If you see nothing related to your GitHub user ID or email or the information is incorrect, continue to the next step.

  2. One at a time, type

    $ git config --global user.name "<username>"
    $ git config --global user.email "<email@address.edu>"
    

    replacing <username> with your GitHub ID or name and <email@address.edu> with your email, leaving the quotes in both cases

  3. Type

    $ git config --list --show-origin
    

    again to confirm that information is now stored (it should print to the Terminal output).

  4. Use Git to confirm it has worked.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you so much! I was also adding another $ in the terminal that didn't need to be there (because it was already there), and I think that was (part of) the problem. – kswp Dec 05 '22 at 17:21