Git学习笔记(八)配置命令别名

git config --global alias.别名 命令

例如:git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

--global 使命令在当前用户有效,如果没有--global那么只在当前repository有效

配置文件在 .git/config文件中 运行 cat .git/config 后,[alias]后面的内容就是别名。

posted @ 2017-01-18 20:08  OHAYO_Mario  阅读(103)  评论(0编辑  收藏  举报