在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

相关推荐
青草地溪水旁2 小时前
Git Bash 中 Git 命令的实用主义指南
git·bash
byte轻骑兵6 小时前
365 天技术创作手记:从一行代码到四万同行者的相遇
ide·vscode·编辑器
奥特曼打小白8 小时前
Visual Studio Code的第一次安装
ide·vscode·编辑器
weixin_456904278 小时前
Vscode中开发VUE项目的调试方案
ide·vue.js·vscode
小猫挖掘机(绝版)8 小时前
通过tailscale实现一台电脑上vscode通过ssh连接另一台电脑上的VMware Linux 虚拟机
linux·windows·vscode·ubuntu·ssh
和小胖11228 小时前
第二讲 Vscode+Python+anaconda 高阶环境配置
ide·vscode·python
陈老老老板10 小时前
Visual Studio Code 中为Copilot 添加 Bright Data 的 Web MCP
ide·vscode·copilot
战南诚1 天前
前端开发vscode插件 - live server
ide·vscode·编辑器
墨抒颖 msy.plus1 天前
[特殊字符] 从零到一:打造你的VSCode圈复杂度分析插件
ide·vscode·编辑器·插件·cursor
vortex52 天前
常见Bash脚本漏洞分析与防御
开发语言·bash