0

我已将 html 文件设置为默认使用 Notepad++ 打开(在 Windows 中)。

当我键入类似的git help commit内容时,它使用 Notepad++ 打开 html 手册页而不是 Chrome。

我想将 Notepad++ 保留为默认的 html 编辑器,但我希望 Git 在 Chrome 中打开手册/帮助页面。我怎样才能做到这一点?

我将此添加到我的.gitconfig文件中:

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

我这样做是因为在 Mac 上这个人也有类似的工作:https ://stackoverflow.com/a/4948249/470749 。

但对我来说,Notepad++ 一直在打开而不是 Chrome。

4

2 回答 2

0

这适用于 Windows 10 上的 Git Bash

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

非常感谢https://stackoverflow.com/a/44639359/470749

于 2017-07-17T16:01:09.343 回答
-1

解决这个问题的一种方法是

google-chrome (html file)

其中html文件是帮助文件的地址。你甚至可以使用快捷方式。

他的以下解决方案对您有用吗?

git config --global web.browser ff
git config --global browser.ff.cmd "open -a Firefox.app"
于 2013-03-10T03:40:05.193 回答