在VSCode中设置bash命令行内容简写

在VSCode中设置bash命令行内容简写

比如,在VSCode的bash中输入 gc daily,而实际执行 git checkout daily.

1、打开shell配置文件

在VSCode终端中输入:
code "D:\Program Files\Git\etc\bash.bashrc"

这里根据自己环境信息修改文件路径。

2、在配置文件的末尾,添加以下行来创建别名
bash 复制代码
alias gc='git checkout'

可以添加多行:

bash 复制代码
alias gc='git checkout'
alias gp='git pull'
alias gpo='git push origin'
alias gsh='git stash'
3、重新加载配置文件以使更改生效

在VSCode终端中输入:
source "D:\Program Files\Git\etc\bash.bashrc"

4、在命令行使用缩写执行命令

比如
gc daily == git checkout daily
gc release == git checkout release
gp == git pull
gpo release == git push origin release
gsh == git stash
gsh pop == git stash pop

相关推荐
lyj1689972 小时前
vue-i18n+vscode+vue 多语言使用
前端·vue.js·vscode
weixin_307779133 小时前
Hive集群之间迁移的Linux Shell脚本
大数据·linux·hive·bash·迁移学习
shimly1234563 小时前
bash 脚本比较 100 个程序运行时间,精确到毫秒,脚本
开发语言·chrome·bash
这是个栗子4 小时前
【问题解决】VSCode终端中看不到Git-Bash
ide·git·vscode
木头没有瓜12 小时前
vscode离线安装插件
ide·vue.js·vscode
小哈龙15 小时前
裸仓库 + Git Bash 搭建 本地 Git 服务端与客户端
开发语言·git·bash
NeRF_er15 小时前
使用 VScode Debug加不上断点的原因
ide·vscode·编辑器
专注VB编程开发20年19 小时前
javascript的类,ES6模块写法在VSCODE中智能提示
开发语言·javascript·vscode
myloveasuka1 天前
信号操作集函数
linux·运维·服务器·c语言·c++·vscode
阿巴~阿巴~2 天前
Linux基本命令篇 —— alias命令
linux·服务器·bash