Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RStudio Git Not Detected

Main Issue: RStudio > New Project > Version Control > Git states that Git was not detected on system path.

Overall, the main issue is that when I attempt to start a New Project under RStudio version control, it states that Git is not on my system path. This is the case despite manually setting the Git executable in Global Options. I can still access a Git-Bash terminal from RStudio and have successfully run basic git commands outlined in Happy With GitR Chapter 9 (https://happygitwithr.com/push-pull-github.html).

Other notes:

  • Git version control still works in VSCode.
  • $ git runs properly in RStudio in both a Git Bash terminal and Windows command prompt.
  • At the end of installing Git, I received 12 error messages, ultimately stating that it was 'Unable to set system config defaults'

Recreate Error Messages

  • Run uninstall for current Git, manually delete any remaining files (usually etc folder)
  • Download Git for Windows at https://gitforwindows.org/
  • No changes to default settings during installer

Attempted Fixes:

  • Updated/Re-installed R and RStudio
  • Updated/Re-installed Git
  • Gone to Tools > Global Options > Git/SVN, manually set Git Executable to C:/Program Files/Git/bin/git.exe
  • Followed Windows specific instructions at Git: Installing Git in PATH with GitHub client for Windows (number 2 solution) by manually adding C:/Program Files/Git/bin/git.exe and C:/Program Files/Git/cmd to my system PATH

Additional Info:

  • Windows machine running Windows 10
like image 773
JackThHanley Avatar asked Aug 11 '26 15:08

JackThHanley


1 Answers

I've had the same problem and tried everything you tried as well. This is what helped me in the end: re-agreeing to the xcode license agreement using xcode-select --install (I have MacOS though).

Source: https://happygitwithr.com/troubleshooting.html#troubleshooting

like image 80
Haiying Avatar answered Aug 14 '26 11:08

Haiying



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!