Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting path to git executable in RStudio under OSX Mountain Lion

I am running RStudio v. 0.97.237 under Mac OSX v. 10.8.2 (Mountain Lion). I am trying to set the path to my git executable file in RStudio. The correct path is /usr/local/git. There is a preference setting in RStudio for entering the path to the Git executable file (Preferences..., Git/SVN, Git executable). If I could simply type "/usr/local/git" into a dialog box, I expect I would be done.

However, RStudio will not allow me to simply type in the directory path. Instead, one is required to browse through the directory tree using the standard OSX browsing ("Choose file") utility. Following an upgrade of OSX from Snow Leopard to Mountain Lion, I find that many system-related directories, including /usr, are no longer visible in the OSX file browsing utility. They are visible in the shell (using XQuartz, command "ls"), but not in the Mountain Lion GUI. (Apparently Mountain Lion thinks it knows what is good for me.)

My questions:

1.) Is there a way in RStudio to set the path to the Git executable file directly, command-line style, without needing to use the OSX directory browsing utility?

2.) Alternatively, is there a way in OSX Mountain Lion to adjust System Preferences to make all directories and files visible, not just the restricted set visible using Mountain Lion's default settings?

3.) Is there some other means to resolve this problem?

Note: I had Git working properly with RStudio under OSX 10.6.8 (Snow Leopard). The problem arose after the upgrade to OSX 10.8.2.

Thank you for any suggestions.

like image 725
Arthur Small Avatar asked Dec 23 '12 15:12

Arthur Small


1 Answers

I was able to find the answer to my question, courtesy of http://osxdaily.com/2009/02/25/show-hidden-files-in-os-x/ and http://support.rstudio.org/help/discussions/problems/2907-no-svn-in-mountain-lion.

To make sure you have the correct path to the Git executable file: open a terminal window, and type:

$ which git

In my case, the answer comes back: /usr/local/git/bin/git.

To make hidden files visible in Mountain Lion: Per osxdaily.com: "You can quickly show all hidden files in any Mac OS X save dialogue box by hitting Command+Shift+Period."

So: in RStudio, in the Git executable settings, click on 'Browse'; when the save dialog box opens, hit Command+Shift+Period. Navigate to the git executable file, select it, and Save.

I found that at least one repository still did not recognize the location of the new Git executable. I had to reset the use of Git as follows: Under 'Project Options...', switch the version control option from 'Git' to 'none'. Restart RStudio to make this change take effect. Then go back into the Project Options, switch the version control option from 'none' back to 'Git', and restart RStudio again.

This worked.

like image 70
Arthur Small Avatar answered Oct 24 '22 20:10

Arthur Small