2
1

More than 3 years have passed since last update.

git help のデフォルトブラウザを変更する

Last updated at Posted at 2020-01-21

gitでコマンドを調べるときに使うgit help <command>/ git command --helpですが、初めの慣れていないうちはターミナルで調べるよりもブラウザの方が見やすかったりします。
Windowですとデフォルトでブラウザに移遷してくれるのでいいんですが、macだとgitconfigで設定しないと、勝手にvisual studio codeとかのエディターでhtmlを表示してしまい、ソースコードが表示されてしまいます。
なので、デフォルトで好きなブラウザで表示する方法を紹介します。

まずは、というか.gitconfig以下のように設定を行っていただければ全部動きます。

[web]
    browser = "opera"
[browser "opera"]
    path = /Applications/Opera.app/Contents/MacOS/Opera

見ての通りですが、[browser="opera"]の下のpathに設定するブラウザアプリまでのパスはダブルクォーてションで囲まないこと。さらに、ブラウザのパスは実際の実行ファイルまでのパスをしてすることが必須です。単に"/Applicaitons/Opera.app"とはしないように。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1