git 简写

在日常的git操作中,git checkout——检出,是我们的常用命令。最为常用的两种情形是创建分支和切换分支。

在下面的命令中,使用了一些简写,在这里说明一下:

git st # git status
git ci  # git commit
git br # git branch
git co # git checkout
git mg # git merge
git line # git log --oneline

当然,你也可以直接在git中敲命令,将这些简写添加到git配置中

git config --global -e

[alias]
    st = status
    co = checkout
    br = branch
    mg = merge
    ci = commit 
    md = commit --amend
    dt = difftool
    mt = mergetool
    last = log -1 HEAD
    cf = config
    line = log --oneline
    latest = for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short) [%(committername)]'

    ls = log --pretty=format:\"%C(yellow)%h %C(blue)%ad %C(red)%d %C(reset)%s %C(green)[%cn]\" --decorate --date=short
    hist = log --pretty=format:\"%C(yellow)%h %C(red)%d %C(reset)%s %C(green)[%an] %C(blue)%ad\" --topo-order --graph --date=short
    type = cat-file -t
    dump = cat-file -p

你可能感兴趣的:(git 简写)