Git 配置别名

在 svn 中,我们可以使用 svn ci 来提交代码,使用 svn up 来更新代码,这就是别名,相当于 Linux 中的 alias,git 同样也可以设置别名

[root@localhost ~]$ git config --list                       # 查看别名
[root@localhost ~]$ git config --global alias.ci commit     # 设置别名
[root@localhost ~]$ git config --global --unset alias.ci    # 取消别名

常用的别名设置:

[root@localhost ~]$ git config --global alias.ci commit
[root@localhost ~]$ git config --global alias.br branch
[root@localhost ~]$ git config --global alias.up update
[root@localhost ~]$ git config --global alias.co checkout
[root@localhost ~]$ 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"

    

原文地址:https://www.cnblogs.com/pzk7788/p/10294264.html