合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
## 方法一,命令行方式配置 ```bash # 执行以下命令后 git config --global alias.st status git config --global alias.ci 'commit -m' # 我们不需要使用 git status git commit -m '<提交信息>' # 只需要使用 git st git ci '<提交信息>' ``` ## 方法二,直接修改 git 的配置文件.gitconfig ```bash # 编辑.gitconfig文件 vim ~/.gitconfig # 将 [alias] # 改为 [alias] st = status ci = commit -m # 并保存退出后 # 我们不需要使用 git status git commit -m '<提交信息>' # 只需要使用 git st git ci '<提交信息>' ``` ## 方法三,直接修改 Git Bash 的配置文件 aliases.sh * 这种方法所做的配置只能使用 Git Bash 工具进行操作,vscode 的命令行终端不支持这种操作 ```bash # 编辑aliases.sh文件 vim /etc/profile.d/aliases.sh # 增加以下代码,并保存退出后 alias gs='git status' alias ga='git add' alias gb='git branch' alias gc='git commit -m' alias gd='git diff' alias go='git checkout' alias gk='gitk --all&' alias gx='gitx --all' alias got='git' alias get='git' # 我们不需要使用 git status git commit -m '<提交信息>' # 只需要使用 gs gc '<提交信息>' ``` ## 方法四,安装 myalias npm 地址:https://www.npmjs.com/package/myalias