• git config —global alias.cm “commit -m”

git commit -m ‘init’ => git cm ‘init’

  • git config —global alias.ck “checkout”

git checkout release => git ck release

  • git config —global alias.ckb “checkout -b”

git checkout -b fix/error => git ckb fix/error

  • git config —global alias.ckM ‘checkout master’
  • git config —global alias.ckD ‘checkout dev’
  • git config —global alias.ckR ‘checkout release’

取消别名

  • git config —global —unset alias.cm

    删除所有别名

  • git config —global —remove-section alias