# "git config get" returns "error: key does not contain a section: get"

3 messages from 2025-06-05 to 2025-06-05. Participants: Scott Birl (Temple Univ), Kristoffer Haugsbakk.
Thread: https://gitlist.dev/t/63590

## Scott Birl (Temple Univ), 2025-06-05 16:16

Subject: "git config get" returns "error: key does not contain a section: get"
Message-ID: <MW3PR11MB47638E3211C195DC1C032DB9C36FA@MW3PR11MB4763.namprd11.prod.outlook.com>
URL: https://gitlist.dev/e/MW3PR11MB47638E3211C195DC1C032DB9C36FA%40MW3PR11MB4763.namprd11.prod.outlook.com

```
Hello all:

Debian 12/bookworm -- git is already the newest version (1:2.39.5-0+deb12u2).
Trying out examples from https://git-scm.com/docs/git-config.html#EXAMPLES

----
$ which git

git is hashed (/usr/bin/git)

-----
$ git config get --type=color --default="reset" ""

usage: git config [<options>]

Config file location
    --global              use global config file
    --system              use system config file
    --local               use repository config file
    --worktree            use per-worktree config file
    -f, --file <file>     use given config file
    --blob <blob-id>      read config from given blob object

Action...
-----

$ git config get --type=color --default="blue reverse" color.diff.whitespace

usage: git config [<options>]

Config file location
    --global              use global config file
    --system              use system config file
    --local               use repository config file
    --worktree            use per-worktree config file
    -f, --file <file>     use given config file
    --blob <blob-id>      read config from given blob object

Action...
----

$ git config get core.filemode

error: key does not contain a section: get
-----

$ git config --global get core.filemode

error: key does not contain a section: get
-----

$ git config --local get core.filemode

error: key does not contain a section: get
-----

pwd: $HOME
cat -n ~/.gitconfig:

     1  [core]
     2          fileMode = true
     3  ###
-----

Can someone explain what's going on?

Thanks.
  
  


```

## Kristoffer Haugsbakk, 2025-06-05 16:33

Subject: Re: "git config get" returns "error: key does not contain a section: get"
Message-ID: <d2829090-de29-466f-b17a-734c5e8bf59a@app.fastmail.com>
URL: https://gitlist.dev/e/d2829090-de29-466f-b17a-734c5e8bf59a%40app.fastmail.com
In-Reply-To: <MW3PR11MB47638E3211C195DC1C032DB9C36FA@MW3PR11MB4763.namprd11.prod.outlook.com>

```
On Thu, Jun 5, 2025, at 18:16, Scott Birl (Temple Univ) wrote:
> Hello all:
>
> Debian 12/bookworm -- git is already the newest version (1:2.39.5-0+deb12u2).
> Trying out examples from https://git-scm.com/docs/git-config.html#EXAMPLES

That looks like Git 2.39.0.

> [...]
> $ git config get core.filemode
>
> error: key does not contain a section: get

`git config get` is from Git 2.46.0.

I get the same error on 2.40.0.

You need `git config --get`. That’s the old syntax.

```

## Scott Birl (Temple Univ), 2025-06-05 16:38

Subject: RE: [External] Re: "git config get" returns "error: key does not contain a section: get"
Message-ID: <MW3PR11MB47631ACCE4347984E192026BC36FA@MW3PR11MB4763.namprd11.prod.outlook.com>
URL: https://gitlist.dev/e/MW3PR11MB47631ACCE4347984E192026BC36FA%40MW3PR11MB4763.namprd11.prod.outlook.com
In-Reply-To: <d2829090-de29-466f-b17a-734c5e8bf59a@app.fastmail.com>

```
> `git config get` is from Git 2.46.0.
> 
> I get the same error on 2.40.0.
> 
> You need `git config --get`. That's the old syntax.

Understood.  Thanks.


```
