I want GIT to open the help pages in Chrome browser by default though the Windows 7 default browser is IE which I can't change for other reasons. I have added the following to the git config file.
[web]
browser = chrome
[browser "chrome"]
cmd = C:/Program Files (x86)/Google/Chrome/Application/chrome.exe
path = C:/Program Files (x86)/Google/Chrome/Application/
But it still opens IE browser. In git's bash environment it gives the message "Launching default browser to display HTML ..."
. On Git Gui, it throws a lengthier message
The browser chrome is not available as 'C:/Program Files (x86)/Google/Chrome/Application/'.
The browser chrome is not available as 'C:/Program Files (x86)/Google/Chrome/Application/'.
while executing
"exec {C:/Program Files (x86)/Git/bin/sh.exe} {C:/Program Files (x86)/Git/libexec/git-core/git-web--browse} {file:C:/Program Files (x86)/Git/doc/git/ht..."
("eval" body line 1)
invoked from within
"eval exec $opt $cmdp $args"
(procedure "git" line 23)
invoked from within
"git "web--browse" $url"
(procedure "start_browser" line 2)
invoked from within
"start_browser {file:C:/Program Files (x86)/Git/doc/git/html/index.html}"
(menu invoke)
Could someone help me resolve this?
EDIT: Also tried
[web]
browser = chrome
[browser "chrome"]
path = C:/Program Files (x86)/Google/Chrome/Application/chrome.exe
Now I am able to open online documentation in chrome from Git Gui. But it does not work in git bash.
Making Chrome the Default BrowserIn the Settings menu, click on Details 🡪 Default Applications. In the Default Applications menu, navigate to the “Web” category and select Google Chrome.
Select Start > Settings > Apps > Default apps.
Git is expecting the config setting browser.<tool>.path
to point to the executable of a recognized browser, not the containing directory. browser.<tool>.cmd
is only used if the browser you specify isn't on the list of recognized browsers (of which "chrome" is one). See the git-web--browse docs for details.
Try using this in your .gitconfig
instead:
[web]
browser = chrome
[browser "chrome"]
path = C:/Program Files (x86)/Google/Chrome/Application/chrome.exe
If you want to customize the command line that's used to launch Chrome, you can give it a name that isn't recognized as a supported browser, and specify the command in cmd
instead:
[web]
browser = specialchrome
[browser "specialchrome"]
cmd = C:/Program Files (x86)/Google/Chrome/Application/chrome.exe --new-window
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With