欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Git 设置别名

程序员文章站 2024-02-24 13:14:52
...

添加别名的方式:

linux: vim ~/.gitconfig ,末尾添加
Windows: 在用户目录下, .gitconfig 文件,末尾添加

添加内容:

[alias]
  a = add
  b = branch
  c = commit
  ci = commit
  d = diff
  st = status
  lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset | %C(bold)%an' --abbrev-commit --date=relative
  r = reset
  aa = add .
  ba = branch -a
  ca = commit -a
  cc = commit -a -m
  cl = clone
  cm = commit -m
  co = checkout
  cp = cherry-pick
  nb = checkout -b
  pl = pull
  ps = push origin master
相关标签: git