我正在尝试设置 git instaweb
以在 Chrome 中打开。我已经像这样设置了默认浏览器:
git config --global web.browser chrome
此更改反射(reflect)在我的全局 .gitconfig
和 git-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 notApplications
)
关于macos - Git instaweb : The browser is not available,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14285017/