Connecting RStudio Cloud to GitHub - r

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 "you#example.com"
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 "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.

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#address.edu>"
replacing <username> with your GitHub ID or name and <email#address.edu> with your email, leaving the quotes in both cases
Type
$ 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.

Related

How to install and use mirthSync on MacOS?

Setup
I'm following the installation directions in the mirthSync readme, which is to clone the repo. The next indication of usage that I can see is in the Examples section, which via CLI is to "pull Mirth Connect code from a Mirth Connect instance":
java -jar mirthsync.jar -s https://localhost:8443/api -u admin -p admin pull -t /home/user/
I'm assuming that after cloning the repo, one should cd into that directory and then run the java -jar... command with all the appropriate flag values (server, username, password, etc).
Error
After running the CLI command, I get this error:
Error: Unable to access jarfile mirthsync.jar
Question
Where is this mirthsync.jar file supposed to come from? Is there something I need to do in order to generate the mirthsync.jar file?
Generate it via lein uberjar (which creates target/uberjar/*-standalone.jar) or download it from a release.

Rstudio greyed out Git commands and (No branch)

I am currently struggling with getting Rstudio to work with my git repositories. When I set up a new project and assign the git repository, the branch is set on Master and the commit, pull, and push buttons are all active. Everything works just fine. Then, at some point the branch is switched to (No Branch) and the commit, pull, and push buttons are greyed out (shown below). This happens to every single git project I make. Works at first then is greyed out.
I am still able to use git commands from Shell, but the GUI interface is not working.
I have spent some time looking through customer support forums and Googling the problem. One site that I found (https://www.r-bloggers.com/things-i-forget-pushpull-greyed-out-in-rstudio/) indicated that there is an issue with the configuration list. However, when I do git config --list, I find that I do have branch.master.remote=origin and branch.master.merge=refs/heads/master at the bottom of the configuration.
I also attempted a git push -u origin master, but that did not work either.
I use RStudio and github daily, and I would be so pleased if the GUI interface was working properly again.
I would be very grateful if someone could help me problem solve this issue.
EDIT: I am using OSX 10.9 Mavericks and Rstudio Version 0.99.903.
I had a similar problem with a repo I had already configured locally and pushed and pulled from/to it using CLI (although I didn't have the problem of being detached from a branch) and I solved it by doing the following:
Open your console and navigate to your repo
Make some commit
Make a push using -u (i.e. --set-upstream) flag, eg: git push origin master -u
Open Rstudio (or restart it if it was open while performing the previous step) and you'll see the push and pull icons are no longer greyed out.
Then, at some point the branch is switched to (No Branch) and the commit, pull, and push buttons are greyed out (shown below).
That is typical of a detached HEAD branch: see "Why did my Git repo enter a detached HEAD state?".
Revert to the command-line and check your git status.
You can easily recover from this by a checkout of a branch.
Or by forcing a branch to your current detached commit
git branch -f branch-name HEAD
git checkout branch-name
Then switch back to RStudio: all options should be available again.
As commented:
Tt turns out to be an RSA key issue.
The wrong key was in the Rstudio Config, which explains how Shell would work but not the Rstudio interface.
I just wanted to provide an update in case anyone in the future had a similar problem. While the answer provided earlier resulted in another temporary fix, I ultimately had to wipe my hard drive; reinstall the operating system; reinstall git, R, RStudio, and reconnect to my Github account before it would consistently work.
My solution may have been a bit overkill, but I have not had an issue with it since.
I had the same issue today and found this post. I am going to share how I solve it:
on terminal (Git) type the following:
$ git config --global user.name
(it should return your Github username)
if username isn't correct just type
$ git config --global user.name "correct_username"
then type
$ git config --global user.email
(it should return an email associated to your GitHub account)
I found a typo in my email and fixed it by typing
$ git config --global user.email "correct_email"
Then I added the origin (this you get it from GitHub)
$ git remote add origin https://github.com/my_username/my_repository.git
Then I setup the branch, most used ones are main and master, in my case it is main
$ git branch -M main
then I pushed from the terminal
$ git push -u origin main
after that my pull and push buttons are active.
I hope this can save some time for others.

Rstudio cant detect git

I trying to create a project from version control. However when I click git I get the following error:
Git was not detected on the system path.
Googling showed me that I to specify my git executable in my options:
So therefore I filled in "C:/Program Files/Git/bin/git.exe" in the field named: Git executable.
Having done this I still receive the same error however.
Any thoughts on what goes wrong here?
Configure RStudio to use git
Open RStudio
Click Tools -> Global Options -> Git/SVN
If Git executable shows (none), click Browse and select the git executable installed on your system
Important:
Restart RStudio if you make any changes.
Read this for more info:
https://stat545-ubc.github.io/git03_rstudio-meet-git.html

RStudio gives "Incorrect function" when setting git as Version control

When I create a new project and select to create a new Git repository, or when I try to change the version control system in project options I receive a RStudio error stating "Incorrect function" with a big X and no extra information.
The below link has a similar issue, but their solution of changing the path for git.exe has not helped (i have tried all three paths)
https://support.rstudio.com/hc/en-us/community/posts/200632528-Git-Error-Incorrect-Function
Some extra notes:
RStudio allows me to clone repository to set new working directory
Also git works in bash, so i feel this is an RStudio issue.
I encountered the same error. For me it also had to do with using a network path not a local directory for the project location (as for lewis1211).
Workaround: Map the network drive. E.g. Map your //server/share to some drive, say Z: (using map network drive, if you are using windows). If you set your project up under Z: then, it works.
If you have already chosen "git.exe" in RStudio --> Tools --> Global Options --> Git/SVN, then try to open Rstudio shell and type git init. In my case it showed "Permission denied", and after running as administrator the problem has gone.
This is only a partial answer if it fixes your problem: I reproduced this when trying to use a network path for a project location. When using a local directory no error occurs. Could indeed be an RStudio issue.
Run you R studio as Project administration.
This solves my issue.
SOLVED.
I had the same problem. The Git-RStudio-Connection fails but git is working perfectly in the CMD. When running the git init command in CMD it works and creates a .git folder. But running the git init command in the RStudio terminal fails with a message Warning: unable to access 'C:/Users/%username%/.gitconfig': Permission denied ... fatal: unknown error occured while reading the configuration files.
The Version Control Sytem (VCS) or git-Panel does not appear in RStudio and selecting it in the projects options leads to the same message Error: Unzulässige Function (eng. Error: Incorrect function).
A closer look into the .gitconfig file should give you a new solution approach hopefully without having administration rights. Comparing the installation on the integration worksation with a productive workstation shows, that on the Test-Machine an incomplete .gitconfig file is on C:/Users/%username%/.gitconfig and on the Productive-Machine a complete gitconfig file is on Z:/.gitconfig. By the way, Z is a mapped drive which is linking to the company's user-profile settings (see CMD > echo %HOMEDRIVE%).
According to this analysis there should be multiple possible solution approaches:
(1) delete the corrupt .gitconfig and hope the the system is correctly looking into your profiles directory
(2) complete the .gitconfig file that all necessary information are there. The message fatal: unknown error occured while reading the configuration files could actually be a hint, that the first message access... permission denied is false and the problem lies in the incomplete file.
(3) Be aware that there can be a confusion between ".gitconfig" as FILE and ".gitconfig" as FOLDER. Check this with changing directory with cd to folder and cat to show the file content. It will tell you that you cannot display a folder as file-content.
(4) Change the location of the config file with git config --file FullnameToGitconfig. e.g. git config --file %USERPROFILE%/.gitconfig or git config --file %USERPROFILE%/.gitconfig/gitconfig or git config --file %HOMEDRIVE%/.gitconfig etc.
[user]
name = DOE John
email = john.doe#acme.com
[merge]
tool = kdiff3
[mergetool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
[diff]
guitool = kdiff3
[difftool "kdiff3"]
path = C:/Program Files/KDiff3/kdiff3.exe
[core]
editor = \"C:/Program Files (x86)/GitExtensions/GitExtensions.exe\" fileeditor

Errors when using RStudio's Git tools

When attempting to push to GitHub from RStudio, I get the following errors.
error: unable to read askpass response from 'rpostback-askpass'
fatal: could not read Username for 'https://github.com':
No such device or address
RStudio has my origin as
https://github.com/rmscriven/other.git
when it actually should be
https://github.com/rmscriven/saber.git
RStudio will not allow me to change the origin from the version control system. Here is what it shows:
Is it possible to change my GitHub origin url from RStudio?
Thanks to the pro tip provided by #krlmlr in the comments,
Use an empty target directory. Look for "clone URL" on your GitHub project page, perhaps choose the SSH variant.
I clicked "clone url" on GitHub once, nothing. Then again, nothing. And once again for good measure, nothing. So I went to the terminal, read the man git help file, and decided to change my password and reconfigure. These are the lines I ran, and it was successful.
git config --global user.name <myuser.name>
git config --global user.email <myuser.email>
git clone https://github.com/rmscriven/saber.git
git pull
Then I went to RStudio and it allowed me to clone my repository, and change the URL of my version control setting. Here's a colorful pic
New project -> Version Control -> Git -> Create Project
Next, magic happened, and I had a copy of my package which I very carefully removed to prepare to push the development tarball to GitHub. Rock on.
#krlmlr, I thank you for nudging me in the right direction. Now I feel like I'm actually doing it the right way. :)
And for fun, try saying 'rpostback-askpass' ten times fast.
I had the same problem and for me these two simple steps worked great:
Add the SSH key from RStudio to my github account.
Change the origin URL and use the -u flag for push/pull once (solution found here).
For 1., in RStudio go to Tools → Global Options... → Git/SVN → view public key, and copy the key. In your browser of choice, logged in on Github, click Edit Profile → SSH keys and paste the copied key here.
For 2., back in RStudio, click Tools → Shell… , then enter:
git remote add origin https://github.com/myname/test.git
git config remote.origin.url git#github.com:myname/test.git
git pull -u origin master
git push -u origin master
Of course, change "myname" to your username and "test.git" to the name of your project. (Or even "github.com" to the URL of your institute's github or similar.)
After doing this once, the Push/Pull buttons in RStudio should work and you don't need the shell anymore!
I've been running into this issue on multiple computers now, with a remote that doesn't support SSH and thus can't leverage password-less login.
The problem in this case is that by default, git ask for the password interactively, and RStudio can't display this graphically. The trick is to use git's credential storage system.
For instance on Mac OS X:
git config --global credential.helper osxkeychain
On Linux one could use the gnome-keyring integration.

Resources