List Git aliases

后端 未结 16 2022
暖寄归人
暖寄归人 2020-12-02 03:43

How do I print a list of my git aliases, i.e., something analogous to the bash alias command?

16条回答
  •  孤城傲影
    2020-12-02 04:12

    Search or show all aliases

    Add to your .gitconfig under [alias]:

    aliases = !git config --list | grep ^alias\\. | cut -c 7- | grep -Ei --color \"$1\" "#"
    

    Then you can do

    • git aliases - show ALL aliases
    • git aliases commit - only aliases containing "commit"

提交回复
热议问题