I am having an issue where the output of git branch
is empty without sudo
. This applies to any git repo (at least all that I have tested), including new ones. I have tested this in zsh
, bash3
and bash5
, both with the bundled version of git
and the Homebrew version. Interestingly, git checkout
autocomplete (using git plugin of oh-my-zsh) still works as expected, as well as git branch --show-current
.
I suspect a UNIX permission problem, but I cannot find any file or directory in .git/
that does not have -r--r--r--
permissions or higher, or that are not owned by current user.
The problem was a bad .gitconfig
. I had the pager set to LESSCHARSET="UFT-8 less -RF
. -F
causes the pager to terminate when it hits EOF
and less
does not keep output after termination, causing the apparent empty output.
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.