macos - Git instaweb : The browser is not available

标签 macos git

我正在尝试设置 git instaweb 以在 Chrome 中打开。我已经像这样设置了默认浏览器:

git config --global web.browser chrome

此更改反射(reflect)在我的全局 .gitconfiggit-web--browse 中文档说 chrome 可以作为传递的东西使用。

当我运行 git instaweb 时,这是我得到的:

The browser chrome is not available as 'chrome'.
http://127.0.0.1:1234    

我也尝试过 google-chrome 并且发生了相同的结果。如何将网络浏览器设置为在 Chrome 中实际打开?

运行 OSX 10.8.2

最佳答案

也许它需要类似于 How can I configure git help to use Firefox? 的解决方案:

git config --global web.browser ch
git config --global browser.ch.cmd "open -a Google Chrome.app"

OP MishieMoo reports你需要完整的路径:

git config --global browser.ch.cmd "open -a \"/Applications/Google Chrome.app\""

Without the absolute path, it was trying to open Chrome.app in my current directory (which was not Applications)

关于macos - Git instaweb : The browser is not available,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14285017/

相关文章:

swift - 在 Swift for OSX 的子类中管理事件处理

git - 如何给 Git 控制台着色?

git - 为什么 git 挂起 - 必须在命令后按 enter 两次?

c++ - 如何在macOS中测量线程的执行时间?

git - 撤销 git pull 错误的分支到 master 上

ios - 当我执行 git push origin master 时,为什么出现错误 : failed to push some refs to 'git@github.com:sshallow/FirstPod.git'

git - 如何 checkout .git

macos - 在 Mac OS Big Sur 中从代码窗口切换到终端的 VS code 快捷方式

ios - 将打包的 Atom Electron OSX 应用程序转换为 IOS

ios - 旧版本的 iOS 模拟器,例如 6 或 5 以及 XCode 5.1 和 OS X 10.9.2