0%

Git命令简写的配置

在使用Git工具时,有些命令比较常用,为了加快输入速度,可以自定义一些简写配置,能提高我们提交代码的效率。

  • 编辑Git配置文件且显示配置文件路径
1
git config --global -e
  • 配置文件 ~/.gitconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[user]
name = xxxxx
email = xxxx@mail.com
[core]
editor = vim
[alias]
a = add
co = checkout
cm = commit
st = status
pl = pull
ps = push
df = diff
lg = log
cp = cherry-pick
ca = commit --amend
br = branch
mg = merge
dt = difftool
mt = mergetool
lo = log --oneline
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset' --abbrev-commit
  • 查看Git配置
1
git config --global -l