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版)