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:
- Download Git, make github account, create new repository called "testing"
- Configure git using git bash with: git config --global user.email "[email protected]" git config --global user.name "your name"
- Open a new project in Rstudio cloud (new project> new project from git repository), using link from repository called "testing"
- 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)
- Create and copy SSH key to github repository "testing"
- Create dummy script
- Save (appears in the cloud folder)
- Stage the dummy script and click commit in the git tab of the environment window
- New window opens--top right has the option to put in a commit message. Tried with and without text there.
- Press commit
- Popup named "Git commit" says "Please tell me who you are. Run git config --global user.email "[email protected]"; 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.
CodePudding user response:
You can see a similar case in this issue
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.
One at a time, type
$ git config --global user.name "<username>" $ git config --global user.email "<[email protected]>"
replacing
<username>
with your GitHub ID or name and<[email protected]>
with your email, leaving the quotes in both casesType
$ git config --list --show-origin
again to confirm that information is now stored (it should print to the Terminal output).
Use Git to confirm it has worked.