eugeneware / eugeneware/git-config

`include` directives in gitconfig are ignored

Open
#8 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
25
Forks
4
PR merge metrics
No merged PRs in 30d

Description

A `.gitconfig` file can `include` other configuration files ([see git documentation](https://git-scm.com/docs/git-config#_includes)) using an `[include]` directive in the main `.gitconfig` file. For example, with the following two files:

```
# file: ~/local-gitconfig
[user]
name = "Me"
```

and

```
# file: ~/.gitconfig
[include]
path = ~/local-gitconfig
```

Git will report a "user.name" config setting of "Me" (it includes the `[user]` section from `~/local-gitconfig`).

In this scenario the `git-config` npm module does not give the expected/correct result. Instead of returning a JSON object like `{"user": {"name": "Me"}}` it will treat the `[include]` directive as just another key and return `{"include": {"path": "~/local-gitconfig"}}`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.