【问题标题】:How do I disable "git requirement" pop up that appears whenever I open RStudio?如何禁用打开 RStudio 时出现的“git 要求”弹出窗口?
【发布时间】:2023-03-09 15:35:01
【问题描述】:

几个月前,我正在探索 RStudio 设置并为 RStudio 项目启用版本控制界面,但因为我没有 Xcode 或命令行开发工具,所以每次打开 RStudio 时都会弹出一个窗口让我很烦, “‘git’命令需要命令行开发工具,”并希望我安装它们。

Popup Window Screenshot

我知道 Xcode 占用了大量存储空间,而我的 MacBook 空间非常有限,所以我不想安装它们。现在已经几个月了,我的容忍度越来越低。我真的希望这个弹出窗口停止。 如何阻止此消息出现?

我尝试过的事情:在 Git/SVN 设置中禁用版本控制并重新启动,关闭所有项目和脚本并重新启动,重新安装/更新 RStudio 和 R。

【问题讨论】:

  • 弹出窗口令人困惑,但它不是要求您安装 XCode,只是命令行工具,大约 130 MB。您也可以尝试单独安装 git

标签: xcode git version-control popup rstudio


【解决方案1】:

这似乎与对 /usr/bin/git 的调用有关,这是 Mac 上 git 的默认安装二进制文件(或至少在我的 - MacBook Air(13 英寸,2015 年初),升级到 Sierra)。执行/usr/bin/git(或/usr/bin/svn)会显示一条xcode消息和对话框。

xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.

我使用 Homebrew 安装了 git,所以它现在位于 /usr/local/bin/git 中。

我的解决方案是将/usr/bin/git 移动到/usr/bin/git.bak(以防万一),并使用sudo ln /usr/local/bin/git /usr/bin/git 符号链接到我的实际git 二进制文件。

【讨论】:

  • 对我不起作用:`sudo mv /usr/bin/git /usr/bin/git.bak mv: rename /usr/bin/git to /usr/bin/git.bak : 不允许操作
  • 这可能是因为文件不在该路径上(该路径是我的 Mac 上的路径,您的路径可能出于任何原因在其他地方,具体取决于操作系统版本等),或者可能是相关的到系统完整性保护。假设这些文件路径和位置是正确的,那么很可能是启用了 SIP。
  • 不。 # ls -l /usr/bin/git -rwxr-xr-x 1 root wheel 31456 Jan 23 05:59 /usr/bin/git 我认为你是对的 - 它是 SIP。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-20
  • 2011-08-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多