2020年3月4日 星期三

[git] git branch output to console git branch --list

[git] git branch output to console  git branch --list

$ git branch
會加上 pager 而不是直接如同 cat 一樣輸出

原來是 2.16 後加上的新功能

$ git branch | cat
$ git branch --list


- git/2.16.0.txt at master · git/git https://github.com/git/git/blob/master/Documentation/RelNotes/2.16.0.txt#L85-L88
"* "git branch --list" learned to show its output through the pager by
   default when the output is going to a terminal, which is controlled
   by the pager.branch configuration variable.  This is similar to a
   recent change to "git tag --list"."

- git config --global pager.branch false
terminal - Git branch command behaves like 'less' - Stack Overflow https://stackoverflow.com/questions/48341920/git-branch-command-behaves-like-less
"As mentioned in comments to Mark Adelsberger's answer, this was a default behavior change introduced in Git 2.16.
You can turn paged output for git branch back off by default with the pager.branch config setting:
git config --global pager.branch false"

- terminal - Git branch command behaves like 'less' - Stack Overflow https://stackoverflow.com/questions/48341920/git-branch-command-behaves-like-less#comment83670608_48342309
"git config --global core.pager cat"

沒有留言:

張貼留言