Oh My Zsh Git 插件

以下是一些常见的别名和它们对应的 Git 命令:

  • g: git
  • ga: git add
  • gaa: git add --all
  • gapa: git add --patch
  • gau: git add --update
  • gb: git branch
  • gba: git branch -a
  • gbd: git branch -d
  • gbda: git branch --no-color --merged | command grep -vE "^(+||*|\s*(main|master|(no branch))\s*$)" | command xargs -n 1 git branch -d
  • gbl: git blame -b -w
  • gbnm: git branch --no-merged
  • gbr: git branch --remote
  • gbs: git bisect
  • gbsb: git bisect bad
  • gbsg: git bisect good
  • gbsr: git bisect reset
  • gbss: git bisect start
  • gc: git commit -v
  • gc!: git commit -v --amend
  • gcn!: git commit -v --no-edit --amend
  • gca: git commit -v -a
  • gca!: git commit -v -a --amend
  • gcam: git commit -a -m
  • gcan!: git commit -v -a --no-edit --amend
  • gcans!: git commit -v -a -s --no-edit --amend
  • gcm: git commit -m
  • gco: git checkout
  • gcd: git checkout develop
  • gcf: git config --list
  • gcl: git clone --recurse-submodules
  • gclean: git clean -fd
  • gpristine: git reset --hard && git clean -dfx
  • gpoat: git push origin --all && git push origin --tags
  • gcb: git checkout -b
  • gcd: git checkout develop
  • gcmsg: git commit -m
  • gco: git checkout
  • gcount: git shortlog -sn
  • gcp: git cherry-pick
  • gcpa: git cherry-pick --abort
  • gcpc: git cherry-pick --continue
  • gd: git diff
  • gdca: git diff --cached
  • gdt: git difftool
  • gf: git fetch
  • gfo: git fetch origin
  • gg: git gui citool
  • gga: git gui citool --amend
  • ggpull: git pull origin $(git_current_branch)
  • ggpush: git push origin $(git_current_branch)
  • gl: git pull
  • glg: git log --stat
  • glgg: git log --graph
  • glgga: git log --graph --decorate --all
  • glgp: git log --stat -p
  • gm: git merge
  • gma: git merge --abort
  • gcm: git commit -m
  • gp: git push
  • gpd: git push --dry-run
  • gpoat: git push origin --all && git push origin --tags
  • gpristine: git reset --hard && git clean -dfx
  • grh: git reset HEAD
  • grhh: git reset HEAD --hard
  • gs: git status -sb
  • gst: git status
  • gsta: git stash push
  • gstaa: git stash apply
  • gstc: git stash clear
  • gstd: git stash drop
  • gstp: git stash pop
  • gsts: git stash show --text
  • gsu: git submodule update --remote --merge
  • gup: git pull --rebase
  • gupv: git pull --rebase -v
  • gwch: git whatchanged -p --abbrev-commit --pretty=medium

激活 Git 插件

如果你使用 Oh My Zsh,并且希望启用这些别名,请确保在你的 ~/.zshrc 文件中激活 Git 插件:

sh 复制代码
plugins=(git)

然后重新加载你的 ~/.zshrc 文件:

sh 复制代码
source ~/.zshrc

这些别名极大地简化了 Git 的常用操作,可以大幅提高工作效率。

相关推荐
AI营销先锋20 分钟前
2025 AI市场舆情分析行业报告:原圈科技如何帮助企业穿越迷雾,寻找增长北极星
大数据·人工智能
Elasticsearch29 分钟前
使用 Node.js Elasticsearch 客户端索引大型 CSV 文件
elasticsearch
TDengine (老段)40 分钟前
TDengine 在新能源领域的最佳实践
大数据·数据库·物联网·时序数据库·tdengine·涛思数据
郑州光合科技余经理1 小时前
海外国际版同城服务系统开发:PHP技术栈
java·大数据·开发语言·前端·人工智能·架构·php
跨境卫士苏苏1 小时前
突围新品广告泥潭:亚马逊广告底层逻辑大重构
大数据·人工智能·算法·重构·亚马逊·防关联
云老大TG:@yunlaoda3601 小时前
开通华为云国际站代理商的UCS服务需要哪些资质?
大数据·数据库·华为云·云计算
百***24371 小时前
GPT5.1 vs Gemini 3.0 Pro 全维度对比及快速接入实战
大数据·人工智能·gpt
天远Date Lab1 小时前
Java微服务实战:聚合型“全能小微企业报告”接口的调用与数据清洗
java·大数据·python·微服务
Elastic 中国社区官方博客2 小时前
Elasticsearch:构建一个 AI 驱动的电子邮件钓鱼检测
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
刘某某.2 小时前
提交 git 的三种方式
git