created: 2021-01-27T02:48:27.000Z

gitconfig alias の '!' の意味

aliasを設定する時の ! は「以下をシェルコマンドとして扱って」という意味。

パイプもできる

$ git config --global alias.ack '! git ls-files --others --cached --exclude-standard | ack -x'

この例はgit管理されてるファイルからackで検索するというもの

ドキュメント

If the alias expansion is prefixed with an exclamation point, it will be treated as a shell command.

参考

例の元ネタ

経済数学の直観的方法 確率・統計編 (ブルーバックス)
[ad] 経済数学の直観的方法 確率・統計編 (ブルーバックス)
長沼伸一郎 (Kindle版)