114

I don't know why but the output from some git command are in editor (vim) and not directly to the terminal output.

For example, the command git branch open vim and list the branches but I would like that the output are directly in the terminal.

I didn't set vim as default editor on the git config.

My config is Ubuntu 18.04 and zsh with oh-my-zsh plugin.

Jan Schultke
  • 17,446
  • 6
  • 47
  • 96
Yan Vh
  • 3,633
  • 3
  • 8
  • 9
  • 2
    Git branch opens vim? Do you have a screenshot? – evolutionxbox May 25 '18 at 09:04
  • 1
    Can you post your `gitconfig` files? There will one in all of the following places: `/etc/gitconfig`, `~/.gitconfig`, and `.git/gitconfig` (this one is the `.git/` inside the repo directory) – rst-2cv May 25 '18 at 09:23
  • 3
    Yes !!! Sorry the command open less and not vim. It is a default behavior change introduced in git 2.16 With `git --no-pager branch` or `git config --global pager.branch false` it's ok – Yan Vh May 28 '18 at 06:33
  • 1
    This happened to me when I switched (suggested by macOS) my shell to zsh with no change to config. – Daniel Widdis Nov 10 '19 at 00:15

1 Answers1

249

Reply to myself.

It is a default behavior change introduced in git 2.16.

With git --no-pager branch or git config --global pager.branch false it's ok

Yan Vh
  • 3,633
  • 3
  • 8
  • 9