GIT ---- GIT命令行简写配置

配置文件种类

  1. /etc/gitconfig:包含了适用于系统所有用户和所有项目的值 --system【查看 --system 配置项】
git config --system -l

在这里插入图片描述

  1. ~/.gitconfig:只适用于当前登录用户的配置 --global【查看 --global 配置项】
git config --global -l

在这里插入图片描述

  1. 位于git项目目录中的.git/config:适用于特定git项目的配置–local【查看 --local 配置项】
git config --local -l

在这里插入图片描述

配置 --global

  1. 常用命令简写配置
git config --global alias.st status
git config --global alias.pl pull
git config --global alias.ps push
git config --global alias.ci commit
git config --global alias.lg log
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.mg merge
  1. 直接修改配置文件
    2.1 查找配置文件位置

    git config --global -e
    

    在这里插入图片描述

    2.2 打开配置文件修改

    [alias]
        co = checkout
        ci = commit
        st = status
        pl = pull
        ps = push
        df = diff
        lg = log
        cp = cherry-pick
        ca = commit -a
    	br = branch
    	mg = merge
    

执行简写命令效果

在这里插入图片描述

Guess you like

Origin blog.csdn.net/m0_38082783/article/details/116118254
Git