• git 之别名配置


      在git操作中有很多命令我们自己可以起别名,以提高操作效率。

    1. 配置方式

        1)项目级别的配置,仅对当前项目生效(将写入到.git/config文件中)
        $ git config --global alias.st status

        2)用户级别的配置(使用--global (将写入到~/.gitconfig中)
        $ git config --global alias.st status
        $ git config --global alias.co checkout

        3)系统级别的配置(使用--system)对整个系统生效
        $ git config --system  对整个系统生效

    2. 常用设置

    $ git config --global color.ui auto
    $ git config --global user.name "test"
    $ git config --global user.email "test@sina.com"
    $ git config --global color.ui auto
    
    $ git config --global alias.st status
    $ git config --global alias.co checkout
    $ git config --global alias.ci commit
    $ git config --global alias.br branch
    
    $ git config --global alias.ps push
    $ git config --global alias.pl pull
    
    $ git config --global alias.unstage 'reset HEAD'
    
    $ git config --global alias.last 'log -1'
    $ 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"
    $ 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"

    3. 其他命令

      查看设置的别名  git config --list | grep alias

      取消别名设置  git config --global --unset alias.st

  • 相关阅读:
    MUI 实现下拉刷新上拉加载的简单例子
    MySQL 游标的使用
    Java 策略模式
    [].slice.call(arguments,1) 个人理解
    Hbuilder + MUI 的简单案例
    传输SO10 (SO10 Transport)
    SAP 供应商/客户的冻结及其删除操作
    SAP FI CO模块常用事务代码
    SAP-批量修改主数据(客户、供应商、物料)
    远程主动读取数据 RFC_READ_TABLE
  • 原文地址:https://www.cnblogs.com/rsky/p/4901694.html
Copyright © 2020-2023  润新知