欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

如何在Git Bash for Windows中设置别名?

程序员文章站 2024-02-24 12:58:22
...

如何在Git Bash for Windows中设置别名?

例如我希望直接调用mvn mybatis-generate,直接写linux默认配置文件似乎不行,需要修改C:\Program Files\Git\etc\profile.d\aliases.sh,添加对应的alias即可

`

# Some good standards, which are not used if the user
# creates his/her own .bashrc/.bash_profile

# --show-control-chars: help showing Korean or accented characters
alias ls='ls -F --color=auto --show-control-chars'
alias ll='ls -l'
alias mybatis-generator='mvn mybatis-generator:generate'

case "$TERM" in
xterm*)
	# The following programs are known to require a Win32 Console
	# for interactive usage, therefore let's launch them through winpty
	# when run inside `mintty`.
	for name in node ipython php php5 psql python2.7
	do
		case "$(type -p "$name".exe 2>/dev/null)" in
		''|/usr/bin/*) continue;;
		esac
		alias $name="winpty $name.exe"
	done
	;;
esac