在 Git 中配置 Aliases(别名)

在 Git 中配置 Aliases(别名) 是提高开发效率的神器。它不仅能让你少敲键盘,还能把复杂的命令组合成简单易记的短指令。
终端执行:git config --global --edit


下面列出了我个人在使用 Git 时发现的一些提高生产力的别名。你可以直接使用它们,或者根据需要进行修改。

bash 复制代码
[alias]
  co = checkout
  cob = checkout -b
  coo = !git fetch && git checkout
  br = branch
  brd = branch -d
  st = status
  aa = add -A .
  unstage = reset --soft HEAD^
  cm = commit -m
  amend = commit --amend -m
  fix = commit --fixup
  undo = reset HEAD~1
  rv = revert
  cp = cherry-pick
  pu = !git push origin `git branch --show-current`
  fush = push -f
  flush = push --force-with-lease
  mg = merge --no-ff
  rb = rebase
  rbc = rebase --continue
  rba = rebase --abort
  rbs = rebase --skip
  rom = !git fetch && git rebase -i origin/master --autosquash
  save = stash push
  pop = stash pop
  apply = stash apply
  rl = reflog
相关推荐
en-route11 小时前
SSH Key 与 GPG Key 区别详解:Git 使用中的身份与签名机制
运维·git·ssh
轻抚酸~12 小时前
使用git维护github项目的简单实践
git·github
C蔡博士14 小时前
Git常用命令
git
胡斌附体15 小时前
linux(ubuntu)拉取源码进行docker容器部署
linux·git·ubuntu·docker·node·nvm
阿白逆袭记15 小时前
Git原理与使用详解(六):连接世界——远程仓库与多人协作入门
git
阿白逆袭记16 小时前
Git原理与使用详解(十):Git大师之路——总结与最佳实践
大数据·git·elasticsearch
C++ 老炮儿的技术栈18 小时前
不调用C++/C的字符串库函数,编写函数strcmp
c语言·开发语言·c++·人工智能·windows·git·visual studio
阿白逆袭记18 小时前
Git原理与使用详解(七):团队交响曲——多人协作开发实战
git
阿白逆袭记18 小时前
Git原理与使用详解(一):版本控制之殇与Git的救赎
git