0

How do I get the command git branch to display its output to standard output directly instead of displaying it in a less editor?

I want to be able to do this

$ git branch
* develop
  master

Instead of typing the command (1) and see the output in a less editor (2):

(1)

$ git branch

(2)

* develop
  master
(END)

I don't want to type git branch | cat every time.

Henry Yang
  • 2,283
  • 3
  • 21
  • 38
  • 4
    Does this answer your question? [Git branch command behaves like 'less'](https://stackoverflow.com/questions/48341920/git-branch-command-behaves-like-less) – megubyte Mar 10 '20 at 23:45
  • Create an alias that uses cat – symlink Mar 10 '20 at 23:51
  • 2
    Technically, less is a pager, rather than an editor, but: `git --no-pager`, or set environment variable `GIT_PAGER`, or configure `core.pager`, or configure `pager.branch` to `false`, etc. (Note that the default behavior used to be the equivalent of having `pager.branch` set to `false`, so that's the accepted answer in the linked duplicate.) – torek Mar 10 '20 at 23:51
  • Can't find the linked answer when I'm about to post this question, got what I want, thanks for the comments! – Henry Yang Mar 11 '20 at 00:52

0 Answers0