Cannot implement git version control on R-Studio (Version Control System: NONE) - r

I'm trying to put a project under version control in R-Studio. I have installed git and everything is working from the git bash command-line. However, when I go to Tools >> Version Control in R-Studio, it says "None" under "Version Control System."
I have attached a screenshot here: http://i.imgur.com/Arc12GG.png
Does anybody know how to fix this?

Even after setting the path to the git executable on my Mac at "Macintosh HD/usr/bin", RStudio still showed "None" for the version control option. In Terminal, I entered "config git" and was greeted by the message that I had to agree to the new Xcode/iOS license. I was able to do that in Terminal by typing "sudo xcodebuild", entering my admin password, then scrolling to the end of the agreement text and entering "agree". Then git showed up as an option for version control. I mention this in case others are stymied even after setting the path to the git executable.

For Windows 10 users, even if you had git lovingly installed at:
C:/Program Files (x86)/Git/bin/git.exe
At some stage the update install moves it into your AppData directory. Thanks Redmond. (I think around Git 2.6.4)
TO FIX:
Make sure like #arvi1000 says above "Did you specify the path to the git executable in Global Options (not project options)? " - set path first in Global options in Rstudio under Tools
Change path under Git/SVN the Git Executable path from Program files to new location of git.exe now in Appdata. e.g. for my userprofile Info:
C:\Users[Your user profile "Info"]\AppData\Local\Programs\Git\bin
Now look in RStudio Project Options under Git/SVN to set Version Control System.
MORE HELP
See these answers in this thread for more and if you cannot find git.exe this is a helpful search tip.

Related

Mac OS 11.2.1 Big sur- git version control Rstudio path -unable to edit . Not able to link

I am new to Version control and this is my first attempt. I am also a novice in R. just did an online course. I have installed Git and was trying to add the Version control through Rstudio Global options. The Git executable file path shows "user/bin/git" But when I go to create a Project>version control>Git- I get an error "Git was not detected on the path" I dug deeper and ran cmd in the mac terminal- which git and got the location as "/usr/local/bin/git", I also did a $ git --exec-path and got the location as "/usr/local/Cellar/git/2.30.0/libexec/git-core" I understand the executable path is somewhere else. I understand that I need to change the path but Rstudio is not allowing the changing of the path, and I am unable to edit the path to "/usr/local/Cellar/git/2.30.0/libexec/git-core" from "user/bin/git". I tried manually entering but that doesnt work, I browsed through the file s and sub folders and selected the executable file location , but it still doesnt change. Please help.
Welcome to stackoverflow: You can find a step by step support on the official support site of rstudio. Here you get detailed instructions on how to use version control with RStudio: https://support.rstudio.com/hc/en-us/articles/200532077-Version-Control-with-Git-and-SVN

run R as administrator

I was using my own laptop to install R and I found that it only has one library. Evne though this library is still read only, everytime when I use Rstudio: install.packages("abc"), I can see that the new packages are stored automatically into that read only library folder.
In my office's desktop, I "believe" I also have administrator role, as I can install and remove anything (by far). I download the latest version of R and I right click the R-3.4.1-win.exe, there is an item "run as administrator", then it is installed in my desktop. However, when I use R studio to install new packages as in my laptop, it always automatically create a personal folder to store the new packages. I don't know why. Is that a way to only have one folder for library? I also tried on the desktop in the plain R mode (without using Rstudio). When I want to install new packages, it always says
Warning in install.packages("devtools") :
'lib = "C:/Program Files/R/R-3.4.1/library"' is not writable
And there is a window pops up to ask me "would you like to create a personal folder?" And if I say no, then
Error in install.packages("devtools") : unable to install packages.
Is there a ways to solve this problem? To just maintain one folder for library
What version of Windows are you using? You should be able to right-click on the Rstudio.exe icon, click Properties, and select an option to always run Rstudio as administrator. Be sure you use that same icon whenever you want to open Rstudio.
Incase of Mac, go to Applications, then right click on RStudio and
Select "Show Package Contents"
Go to Contents/MacOS
Now open terminal(in bash mode). Type sudo and drag the RStudio.exec into terminal and press on ENTER
Now RStudio will have admin access!
For completeness, I think there should be an Ubuntu answer to go along with the Microsoft and Apple answers. (Note:I'm using 18.06, and not 20.x.)
What doesn't work:
On my Ubuntu/Linux system, when Rstudio is installed the call start RStudio from a terminal looks something like the following:
(base) username#sysname:~$ rstudio
It starts, but has the permissions of the user, and can have access errors.
What gives admin power:
To give it better permissions, you can use sudo.
(base) username#sysname:~$ sudo rstudio
[sudo] password for username: <enter password here>
It starts in a different user location, but has more power. After it is installed you can run it the regular way and the packages are still installed.
Extra credit:
Here are some (currently) relevant links for RStudio on Ubuntu:
https://linuxhint.com/rstudio-for-ubuntu/
https://www.r-bloggers.com/2013/03/download-and-install-r-in-ubuntu/
What is the command to invoke RStudio from Command Line in linux environment?
http://web.cs.ucla.edu/~gulzar/rstudio/index.html

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