怎么简写git的操作命令?

已邀请:

zkbhj - 凯冰科技站长

赞同来自:

常用的命令可以简写成以下形式:
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 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
这样,你也就可以使用这些简写的命令咯。

要回复问题请先登录注册