0

I've set html files to open with Notepad++ by default (in Windows).

When I type something like git help commit, it uses Notepad++ to open the html manual page instead of Chrome.

I want to keep Notepad++ as the default html editor but I want Git to open manual/help pages in Chrome. How can I do that?

I added this to my .gitconfig file:

[web]
    browser = googchr
[browser "googchr"]
    cmd = \"/C/Users/MY_USERNAME/AppData/Local/Google/Chrome/Application/chrome.exe --new-window\"

I did it that way because something similar worked for this guy on Mac: https://stackoverflow.com/a/4948249/470749.

But for me, Notepad++ keeps opening instead of Chrome.

Community
  • 1
  • 1
Ryan
  • 22,332
  • 31
  • 176
  • 357

2 Answers2

0

This works for me in Git Bash on Windows 10

[web]
    browser = googchr
[browser "googchr"] 
    path = C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe

Many thanks to https://stackoverflow.com/a/44639359/470749!

Ryan
  • 22,332
  • 31
  • 176
  • 357
-1

One way to get around this is to do

google-chrome (html file)

Where the html file is the address of the help file. You could even use a shortcut.

Did his following solution work for you?

git config --global web.browser ff
git config --global browser.ff.cmd "open -a Firefox.app"
jfa
  • 1,047
  • 3
  • 13
  • 39
  • I don't know what you mean by saying "One way to get around this is to do `google-chrome (html file)`". Exactly what should I type into my Git Bash? Also, his solution (using `"open -a Firefox.app"`) is for Mac. Thanks. – Ryan Mar 10 '13 at 04:07
  • I mean if you know the address of the help file, you can type google-chrome (ADDRESS), and call the browser by name. That may or may not help. Its possible that the git commands are identical for Mac and Win. I don't see why they wouldn't be. – jfa Mar 14 '13 at 06:49