git操作命令缩写配置

为了方便平时的git操作,将其命令配置成简写。需要在 ~目录下增加文件.gitconfig,配置如下内容。

[user]
	name = xxx
	email = xxx@xxx.com
[diff]
	#external = ~/gitdiff.sh
[alias]
    unstage = reset HEAD --
    br = branch
    co = checkout
    df = diff
    dfc = diff --cached
    st = status
    cl = reset --hard HEAD --
    cp = cherry-pick
    last = log -1 HEAD
    pt = format-patch --stdout HEAD^
    showf = show --name-status
#graphical log
    glog = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
#short log
    slog = log --pretty=format:'%H - %an, %ar : %s' --name-only
#very short log
    vslog = log --pretty=format:'%H - %s : %an, %ci'
    vslog1 = log -n 10 --pretty=format:'%H - %an, %ar : %s'
    listtags = log --tags --simplify-by-decoration --pretty='format:%H %ai %d %s'
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页