1

git version 2.45.0.windows.1 Windows 10 Enterprise

I have recently experienced a weird behaviour with my git installation. Suddenly i got git not recognised as external or internal command when keying it in on the cmd command prompt.

I checked that it's actually installed under program and files, and so i added it to the system path environment variables.

It now recognises the git command but I can't access its content, branches, log, git config --global --list etc. When issuing this commands I get

there is no -F option ("less --help" for help)>

Any idea what this may be?

4
  • What precisely do you type? Does Git work if you call it with the full path? In any case, the output suggests that Git invokes less as a pager but doesn't do that correctly. Commented Jun 17, 2024 at 9:07
  • In git-bash open the 2 files /etc/gitconfig and ~/.gitconfig with notepad /etc/gitconfig and notepad ~/.gitconfig. Search for less and check if any option (like core.pager) is set to less. Commented Jun 17, 2024 at 9:13
  • I'm guessing you have an environment variable LESS with options which are not compatible with less. Commented Jun 17, 2024 at 12:17
  • no explicit mention in the config about the pager. Nevertheless doing the command using --no-pager managed to display the expected outcome. I have done git config --global core.pager "" and now i get expected outcomes consistently. I neverthless get <error: cannot spawn --list: No such file or directory< Commented Jun 17, 2024 at 15:22

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.