1

I am facing a problem with one particular Git repo in my local machine. I am using Windows 10. I do not have this problem with other repos. The problem occurs in both pycharm and in cmd and seems to be limited to git branch and git log commands.

When I run either of these commands I get the following error:

Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...

Press ENTER or type command to continueVim: Finished.
Vim: Error reading input, exiting...

Vim: Finished.

From this link I realized that adding the --no-pager option allows me to circumvent this problem and output the desired result. I checked some items in git config related to pagers but nothing amounting to solving the problem.

Why does this occur, and what I can do to fix it?

halfer
  • 19,824
  • 17
  • 99
  • 186
user32882
  • 5,094
  • 5
  • 43
  • 82
  • Does setting your `TERM` environment variable to either `cygwin` or `msys` as [suggested in an answer to a related question](https://stackoverflow.com/a/7950092/123109) silence the warnings? – Greg Bacon Sep 06 '19 at 14:47
  • Unset `git config core.pager` in the repository or set it to `less`. – phd Sep 06 '19 at 14:55
  • Did you set your pager (locally, for this repository) to vim? – torek Sep 06 '19 at 15:22
  • @phd I think I might have accidentally reset my pager to `vim`. When I do `git config --local core.pager` I get `vim`. When I do `git config --global core.pager` I get nothing. How to I unset the local configuration variable? – user32882 Sep 06 '19 at 18:34

1 Answers1

0

Thanks to @phd's comment I was able to find the problem. I ran git config --local --edit and found that pager was set to both vim and notepad++. I deleted both entries, such that no pager variable is defined at all in my local configuration file and reran git branch and it worked.

user32882
  • 5,094
  • 5
  • 43
  • 82