How to set aliases in the Git Bash for Windows?

后端 未结 8 1694
渐次进展
渐次进展 2021-01-29 19:34

How to alias command in Git Bash for Windows downloaded from git-scm.com ?

I mean Bash commands not Git.

(windows7)


Edit:

Writing aliases i

8条回答
  •  长情又很酷
    2021-01-29 20:11

    To configure bash aliases, it's the same as if you were on a Unix platform: put them in a .bashrc in your home:

    cd
    echo alias ll=\'ls -l\' >> .bashrc
    

    To have this change taken into account you should then either source this file (ie: run source .bashrc) or restart your terminal

    (In some cases* you can find equivalent for .bashrc file in C:\Users\\AppData\Local\GitHub\PortableGit_\etc\profile.d\aliases.sh. And you should add aliases in aliases.sh.)

    (*this case is when you install Git for Windows GUI release from https://git-scm.com/download/win that contains GitBash)

提交回复
热议问题