Skip to content

Latest commit

 

History

History
45 lines (37 loc) · 744 Bytes

05-git-aliases.md

File metadata and controls

45 lines (37 loc) · 744 Bytes

Git aliases

git config --global alias.co checkout

You should use git aliases instead of your shell aliases to have autocompletion on them.

$ git co some-br<t>
$ git co some-branch-name

You can use ! to execute non git command

$ git config alias.sayHello '!echo hello'
$ git sayHello
> hello

Here is my alias section in git config

[alias]
  a = add
  ad = add
  br = branch
  ci = commit -S
  co = checkout
  cob = checkout -b
  com = checkout master
  codestyle = commit -S -m 'Address code style offences'
  cp = cherry-pick
  dc = diff --cached
  df = diff
  f = fetch --all --prune
  p = pull
  pu = push -u
  s = status --short
  st = status
  unstage = restore --staged