windows git bash 设置别名提高效率

windows 桌面或任意资源管理器位置,右击,选择Git Bash Here,即打开了git bash命令行。
先设置下主题,右击选择options, Looks > theme > dracula
我选择的是dracula主题,看起来比较舒适。还可以设置字体等。

// 跳转到根路径
cd ~
// 查看下是否有.bash_profile文件
ls
// 如果没有.bash_profile文件,需要创建
touch .bash_profile
// 打开编辑 (笔者这里安装了vscode,所以直接用其打开文件)
vim .bash_profile

可以根据修改设置一些别名。
比如我们常用的git status命令,可以封装成gst。清屏clear命令封装成cls

alias gst='git status'
alias cls='clear'

每次修改这个文件需要输入source ~/.bash_profile重载这个文件,才会生效。
code ~/.bash_profile,用vscode编辑这个配置文件,封装成一个命令。
比如:

alias rl='source ~/.bash_profile'
alias bashconfig='code ~/.bash_profile'
发布了6 篇原创文章 · 获赞 0 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/manbudezhu/article/details/103553471