Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git help command does not open in configured browser

I have newly installed Git for Windows on Windows 8.1. In Git Bash, when I run help commands like git help diff or git diff --help the corresponding .html help file will open in the program I have associated with .html file extensions, regardless of my help.browser and web.browser Git configuration properties.

My Git configuration:

git config --global help.browser chrome    
git config --global web.browser chrome    

My Windows Default Programs file extension association: .html opens with Sublime Text

So, git diff --help in Git Bash opens git-diff.html in Sublime Text. I want it to open in Chrome.

The source of this might be another problem: when I do the command git web--browse URL/FILE (e.g. git web--browse index.html) I get

$ The browser chrome is not available as 'chrome'

git-web--browse documentation: http://git-scm.com/docs/git-web--browse.html

I found this question: How can I configure git help to use Firefox? but that didn't work for me (maybe because I'm running Windows). I tried this:

git config --global help.browser chr
git config --global browser.chr.cmd "start chrome"

Does anyone know of a solution that will allow me to open the help files in Chrome instead of Sublime Text?

like image 229
David Groomes Avatar asked Feb 01 '14 06:02

David Groomes


People also ask

How do I use the Help command in git?

Git Help can be accessed from your Git Bash just by typing the command git help . Press Enter to execute the help command. This command will display all the information about Git. These are brief information to get any beginner started.

Which git command offers browser based help?

The web browser can be specified using the configuration variable help. browser , or web. browser if the former is not set. If none of these config variables is set, the git web--browse helper script (called by git help) will pick a suitable default.

How do I see git help?

If you are having trouble remembering commands or options for commands, you can use Git help . There are a couple of different ways you can use the help command in command line: git command -help - See all the available options for the specific command.


2 Answers

It looks like there is no Git configuration that makes help commands open in the browser. Any Git configuration is overridden by Windows' .html filetype association. For explanation see this Google Group thread at msysGit https://groups.google.com/d/msg/msysgit/bBVP3DKyKzc/fpzK8moJXOgJ

like image 110
David Groomes Avatar answered Sep 19 '22 04:09

David Groomes


I had the same problem, also using Git for Windows running Windows 8.1. The following worked for me:

Change the app that Windows uses by default for files of type .html and .htm. For instructions on that see: http://windows.microsoft.com/en-us/windows-8/choose-programs-windows-uses-default .

like image 20
aap Avatar answered Sep 19 '22 04:09

aap