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 的常用操作,可以大幅提高工作效率。

相关推荐
云老大TG:@yunlaoda36034 分钟前
如何进行华为云国际站代理商跨Region适配?
大数据·数据库·华为云·负载均衡
字节数据平台1 小时前
刚刚,火山引擎多模态数据湖解决方案发布大数据运维Agent
大数据·运维·火山引擎
YangYang9YangYan2 小时前
2026高职会计电算化专业高价值技能证书
大数据·学习·区块链
老蒋新思维2 小时前
从「流量算法」到「增长算法」:AI智能体如何重构企业增长的内在逻辑
大数据·网络·人工智能·重构·创始人ip·创客匠人·知识变现
五度易链-区域产业数字化管理平台3 小时前
大数据与 AI 赋能招商全流程:五度易链平台的技术架构与实践应用解析
大数据·人工智能
Asurplus3 小时前
Centos7安装Git环境
git·centos·yum·dnf
Moonbeam Community3 小时前
Polkadot 2025:从协议工程到可用的去中心化云平台
大数据·web3·去中心化·区块链·polkadot
阿里云大数据AI技术3 小时前
DataWorks 又又又升级了,这次我们通过 Arrow 列存格式让数据同步速度提升10倍!
大数据·人工智能
m0_743125134 小时前
claude --version 报错Claude Code on Windows requires git-bash (https://git-scm.com/downloads/win).
开发语言·git·bash
AntoineGriezmann5 小时前
Git:新建功能分支并解决 Merge 冲突
git