配置.gitconfig缩写
可以参考博客2:让Git的输出更友好: 多种颜色和自定义log格式
cd ~
vi .gitconfig
在文件中写入:
[alias]
br = branch
st = status
cm = commit -m
df = diff
ck = checkout
re = remote
pl = pull --rebase origin
ps = push origin
ft = fetch -p origin
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
演示效果:
配置~/.bashrc 缩写
alias la="ls -a"
alias fn="find -name"
alias reader="cd /c/Users/Public/work/work/codereader_plus"
alias gr="grep -nr"
配置完后 source ~/.bashrc
git log 中文乱码
git config --global i18n.commitencoding utf-8
git config --global i18n.logoutputencoding utf-8
export LESSCHARSET=utf-8