Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does git mean "wrong number of arguments"?

Tags:

git

git-config

I wanted to get all the git config entries, so I glanced over the options and found --get-all, but it gave:

C:\>git config --global --get-all
error: wrong number of arguments
usage: git config [<options>]

It doesn't seem to specify a number of arguments, it just says [<options>]. And I don't know what other options it would need.

like image 869
1j01 Avatar asked Feb 27 '18 22:02

1j01


2 Answers

For viewing the entire config, the correct argument is --list, not --get-all (or you may also want --edit).

The "number of arguments" is of arguments to the argument (or so to speak), subarguments; it's just a really vague error message.

like image 103
1j01 Avatar answered Oct 05 '22 20:10

1j01


You have set it

git config --global --get-all

but as you can see in the help section right below

Action
    --get                 get value: name [value-regex]
    --get-all             get all values: key [value-regex]

So that means you are missing the key argument and optionally the value-regex argument.

You can read more about it in the docs.

like image 38
dippas Avatar answered Oct 05 '22 18:10

dippas