4

Windows下git bash添加alias

 3 years ago
source link: https://www.zhyea.com/2021/07/22/windows-git-bash-set-alias.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Windows下git bash添加alias

2021年7月22日 作者:白42

windows下的git bash算是最简单直接的linux命令行工具了。我平时也喜欢将之用为Jetbrains家各种IDE的terminal。

但是使用git bash时,有些习惯的linux命令,如ll,是没有的,只能使用ls -l。因此需要想办法添加alias。

步骤大致如下:

  1. 打开git安装目录下的etc目录(如:D:\Program Files\Git\etc)
  2. 编辑这个目录下的bash.bashrc文件
  3. 添加如下命令:
alias ls='ls -F --color=auto --show-control-chars'
alias ll='ls -l'
alias grep='grep --color'

大致就是这样。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK