zoukankan      html  css  js  c++  java
  • Git命令输出调整显示方式

    一、场景

    使用git branch查看所有分支时,发现git是以分页的形式显示的,当对分支名进行操作复制粘贴时非常不方便:

    希望将指令输出内容改成直接输出到终端显示:

    二、解决方法

    使用帮助手册命令man git-config搜索关键字并查看配置开关:

    pager.<cmd>
        If the value is boolean, turns on or off pagination of the
        output of a particular Git subcommand when writing to a tty.
        Otherwise, turns on pagination for the subcommand using the
        pager specified by the value of pager.<cmd>. If --paginate or
        --no-pager is specified on the command line, it takes precedence
        over this option. To disable pagination for all commands, set
        core.pager or GIT_PAGER to cat.
    

    那么使用以下命令git config --global pager.xxx false就可以将命令输出改为输出到终端:

    git config --global pager.branch false # git branch 以打印到终端显示
    git config --global pager.branch true  # git branch 在终端中分页进行显示
    

    参考文章

    [1] git branch 不单独输出在终端

  • 相关阅读:
    MIB Browser使用方法
    RestTemplate调用https接口跳过证书验证
    Looper&Handler
    Thread类以及常见得同步类
    Android 关键类(RefBase,sp, wp)
    JNI
    binder
    struct enum union区别
    Q_PROPERTY
    linux 命令
  • 原文地址:https://www.cnblogs.com/macrored/p/13972481.html
Copyright © 2011-2022 走看看