Skip to contentSkip to conversation

Git config not working correctly with included configurations

DISCUSSION Rudinei Goi Roecker 4 participants 6 messages Jun 16, 2016 2 messages not in the archive

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive

Sorry, I thought this list has 'reply to all' set by default...

Stefan

-------- Weitergeleitete Nachricht --------
Betreff: Re: Git config not working correctly with included configurations
Datum: Tue, 12 Apr 2016 13:56:57 +0200
Von: Näwe, Stefan <[email protected]>
An: Rudinei Goi Roecker <[email protected]>

Am 12.04.2016 um 13:25 schrieb Rudinei Goi Roecker:

Quoted 11 lines

I'm having a problem with included configurations in ~/.gitconfig, when using this command:

git config --global user.email

It doesn't return anything, in commits it works as intended. The configuration looks like this:

~/.gitconfig
[include]
path = .gitconfig.user

Maybe you want to use

path = ~/.gitconfig.user

here.

Quoted 6 lines
# ... more configurations

~/.gitconfig.user
[user]
name = My Full Name
email = [email protected]

HTH,
Stefan

Signature · 4 lines
----------------------------------------------------------------
/dev/random says: CURSOR: What you become when your system crashes.
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')" 
GPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF
#3 lore raw
In reply to a message not in the archive

I tried changing to ~/.gitconfig.user and /home/<user_name>/.gitconfig.user, still causes the same problem

Quoted 26 lines · On 12-04-2016 08:56, [email protected] wrote:

Am 12.04.2016 um 13:25 schrieb Rudinei Goi Roecker:

Quoted 11 lines

I'm having a problem with included configurations in ~/.gitconfig, when using this command:

git config --global user.email

It doesn't return anything, in commits it works as intended. The configuration looks like this:

~/.gitconfig
[include]
path = .gitconfig.user

Maybe you want to use

path = ~/.gitconfig.user

here.

Quoted 6 lines
# ... more configurations

~/.gitconfig.user
[user]
name = My Full Name
email = [email protected]

HTH,
Stefan

#4 lore raw

I'm having a problem with included configurations in ~/.gitconfig, when using this command:

git config --global user.email

It doesn't return anything, in commits it works as intended. The configuration looks like this:

~/.gitconfig
[include]
path = .gitconfig.user

# ... more configurations

~/.gitconfig.user
[user]
name = My Full Name
email = [email protected]

I'm using Fedora 23, git version 2.5.5

#5 lore raw
Quoted 8 lines · Rudinei Goi Roecker

I'm having a problem with included configurations in ~/.gitconfig, when using this command:

git config --global user.email

It doesn't return anything, in commits it works as intended. The configuration looks like this:

I think you need:

	git config --global --includes user.email

or simply:

git config user.email

See the documentation of the --includes and --no-includes options in git-config(1).

#6 lore raw
In reply to Rudinei Goi Roecker
Quoted 4 lines · Rudinei Goi Roecker

I'm having a problem with included configurations in ~/.gitconfig, when using this command:

git config --global user.email

You need to turn on "--includes" explicitly. From "git help config" in v2.8.0:

--[no-]includes
Respect include.* directives in config files when looking up values. Defaults to off when a specific file is given (e.g., using --file, --global, etc) and on when searching all config files.

Quoted 1 line

I'm using Fedora 23, git version 2.5.5

The rule above has always been the case, but the documentation made it more clear in v2.8.0.

-Peff

#7 lore raw

Thanks, I didn't knew about that option, as Jeff King said, the documentation is way more explicit about how it works in 2.8.0

Quoted 19 lines · Jeff King
Quoted 4 lines · Rudinei Goi Roecker

I'm having a problem with included configurations in ~/.gitconfig, when using this command:

git config --global user.email

You need to turn on "--includes" explicitly. From "git help config" in v2.8.0:

--[no-]includes
Respect include.* directives in config files when looking up values. Defaults to off when a specific file is given (e.g., using --file, --global, etc) and on when searching all config files.

Quoted 1 line

I'm using Fedora 23, git version 2.5.5

The rule above has always been the case, but the documentation made it more clear in v2.8.0.

-Peff