5

I'm trying to setup git instaweb to open in Chrome. I have set the default browser like so:

git config --global web.browser chrome

This change is reflected in my global .gitconfig, and the git-web--browse documentation says that chrome is available as something to pass in.

When I run git instaweb this is what I get:

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

I have also tried google-chrome and the same results happen. How can I set the web browser to actually open in chrome?

Running OSX 10.8.2

MishieMoo
  • 6,620
  • 2
  • 25
  • 35

1 Answers1

4

Maybe it needs a solution similar to 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"

The OP MishieMoo reports you need the full path:

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)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    This works with a slight modification: `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). – MishieMoo Jan 14 '13 at 22:50
  • @MishieMoo Interesting. I have included your comment in the answer for more visibility. – VonC Jan 15 '13 at 07:15