text 在~~ / gitconfig上定义的别名

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 在~~ / gitconfig上定义的别名相关的知识,希望对你有一定的参考价值。

# basic commands
  a = add
  b = branch
  cp = cherry-pick
  s = status -s
  cl = clone
  ci = commit
  ck = checkout
  br = branch
  diff = diff --word-diff
  dc = diff --cached
  r = reset
  r1 = reset HEAD^
  r2 = reset HEAD^^
  rh = reset --hard
  rh1 = reset HEAD^ --hard
  rh2 = reset HEAD^^ --hard
  po = pull origin

  # one-line log
  l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short

  # list aliases
  list = "!git config -l | grep alias | cut -c 7-"

  d = diff
  ds = diff --stat
  dc = diff --cached

  undo-commit = reset --soft HEAD~1

  ac = !git add . && git commit -am

  # shows configuration in editor
  ec = config --global -e

  # create a new branch
  cob = checkout -b

  # commit
  cm = !git add -A && git commit -m

  # adds all changes including untracked files and creates a commit
  save = !git add -A && git commit -m 'SAVEPOINT'

  # only commits tracked changes
  wip = commit -am "WIP"

  # which resets the previous commit, but keeps all the changes from that commit in the working directory
  undo = reset HEAD~1 --mixed

  amend = commit -a --amend

  # This commits everything in my working directory and then does a hard reset to remove that commit. The nice thing is, the commit is still there, but it's just unreachable
  wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard

  # log graph
  lg = log --graph --oneline --decorate --all
  lgs = log --graph --oneline --decorate --all --name-status
  l1 = log --oneline
  l2 = log --decorate --pretty=format:"%h%x09%an%x09%ad%x09%s"
  ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
  ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
  lnc = log --pretty=format:"%h\\ %s\\ [%cn]"
  lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
  ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
  le = log --oneline --decorate

  # history
  filelog = log -u
  fl = log -u
  dl = "!git ll -1"
  dlc = diff --cached HEAD^

  # find
  f = "!git ls-files | grep -i"

  #open files edited in last commit
  last = "!subl $(git show HEAD --format="" --name-only | xargs)"

  # initial empty commit
  empty = "!git commit -am\"[empty] Initial commit\" --allow-empty"

  # show all deleted files
  deleted = log --diff-filter=D --summary

以上是关于text 在~~ / gitconfig上定义的别名的主要内容,如果未能解决你的问题,请参考以下文章

text 我当前的.gitconfig别名

text gitconfig

text GitConfig是美丽日志的别名

text 的.gitconfig

text 的.gitconfig

text 备份.gitconfig