简体   繁体   中英

Git and Vim - Formatted wrong with git diff, but correct with git commit --amend

I am using Ubuntu for Windows.

Vim and git work fine when calling git commit --amend , but calling git diff or git log results in improperly formatted output. Can anyone please explain when the output is not formatted correctly like when calling git commit --amend ?

I'm using zsh with git aliases, which is why it says I called gc! and not git commit --amend , etc.

git commit --amend

混帐差异

The stuff you're seeing—the [32m , [m , and so on—is the result of partly, but not completely, stripping out colorization codes. Git is printing ESC [ (optional digits) m so as to tell your terminal emulator / display window to change colors, backgrounds, and so on. The pager you're using is for some reason removing the ESC but leaving the rest in.

To find out which pager you're using, use:

git var GIT_PAGER

To correct its behavior... well, that depends on which pager you're using. :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM