RStudio IDE not finding git after MacOS update

git
ide

#1

I am teaching a class in which students use RStudio and Github. Everything went well for most of the semester but in the last couple of weeks, several students who use Macs updated their OS and now RStudio says it can’t find git on the system path.

The git executable is installed on /usr/bin/git, with an additional symlink to that executable from /usr/local/bin/git. echo $PATH shows /usr/local/bin:/usr/bin as the first two entries in the PATH. From a terminal (and also from the terminal window in RStudio), which git returns /usr/bin/git and I can successfully run git commands (git clone, git add, git commit, etc.).

I have manually set the path to the git executable in RStudio global options to /usr/bin/git, but RStudio continues to insist that it can’t find git on the system path, so my students can only use git by typing git commands into a terminal window (either the OS/X terminal or the terminal window in RStudio).

My students have tried downloading and installing the latest git executable from https://git-scm.com and the problem persists.

I am not a Mac person (I know Linux and Windows) so if anyone has had similar issues and has advice for how to help my students get git working again, I would be grateful.


#2

So, despite the fact that I haven’t updated my Mac, I ran into what seemed like a similar problem this weekend. Based on the thread of helpful replies, it seems like homebrew was the key to salvation for other people. (I ended up doing a weird workaround involving using a GitHub PAT in my .renviron file, which I don’t recommend).

Also possibly some tinkering with xcode:


#3

I ran into this problem as well when I updated to the newest OS. Originally my global options in RStudio was pointing to usr/bin/git. I was able to fix the problem by changing the path of my global options to the usr/local/bin/git path. I used the browse option and when I selected the git executable in the usr/local/bin repo the path was automatically changed to this: /usr/local/Cellar/git/2.14.2/bin/git.


#4

I have had several students have similar issues this semester with their Macs and updating to High Sierra. I’ve found that I often need to re-download macOS CLT from XCode after upgrading. This downloads git and several other base compilers. Usually students have done that and it went back to working.

I run a pretty much exclusive Homebrew setup up and I’ve needed to do this every time I’ve upgraded OS but also students who don’t use Homebrew have resolved the issue by redownloading CLT

http://railsapps.github.io/xcode-command-line-tools.html


#5

Thanks for all the helpful suggestions.l I have passed a summary to my students, focusing on the xcode CLT, since these are not homebrew users. I will report back on how things went for them.


#6

I had protracted homebrew problems this week following my High Sierra upgrade. It was partly because I’d forgotten to reinstall XCode CLT and brew update and brew upgrade, but also because I’d foolishly set anaconda to use python3 as its default environment (so python was symlinked to python3. It destroyed like half the stuff I’d downloaded or updated via homebrew :cry:


#7

High five for anaconda path ruining everything!! (I did that too…)