5

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
Phil
  • 7,287
  • 3
  • 36
  • 66
JackThHanley
  • 51
  • 1
  • 2
  • What RStudio version are you using? Where exactly is it telling you it's not on your system path? (Upload a screenshot to imgur might help) What does `Sys.which("git")` return in the Rstudio console? Or try `where git` in the Terminal window. – MrFlick Apr 18 '20 at 19:17
  • @MrFlick `Sys.which("git")` returns C:\\PROGRA~1\\Git\\bin\\git.exe. I am currenrly running the latest version of RStudio available at https://rstudio.com/products/rstudio/download/#download (1.2.5042 ). Missed this comment earlier, sorry for the much delayed response. – JackThHanley Apr 27 '20 at 21:02
  • I have additional information about the issue posted here: https://community.rstudio.com/t/rstudio-git-not-detected-git-tab-disappeared/62072 – JackThHanley Apr 27 '20 at 21:07

1 Answers1

3

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

Haiying
  • 31
  • 6
  • Further discussed here: https://stackoverflow.com/questions/52522565/git-is-not-working-after-macos-update-xcrun-error-invalid-active-developer-pa – sbha Mar 24 '21 at 16:04