Git Config File Reference?


I work with more then one Git Account.

My idea is to enter username and mail address in the config file in the .git directory.
Git returns the error value:
fatal: bad config line 8 in file .git/config

Therefore I look for the reference of the file config

repository format version = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true

Who can help me? Or has other ideas? I work with VS Code, if there is a more elegant solution


The problem is that you’re adding user section settings to the core section. Two options to fix this:

  1. Use git config instead of editing the file manually (the linked documentation also describes the file format).
  2. Manually create a user section in the config file for the name and email settings, like so:
        name = Your Name
        email =

Hello airtower-luna

Thanks for your help. I test this asap

This documentation don’t help.
I read the Section " CONFIGURATION FILE".
But i can’t find Sections like [User]

“git config” (global) is not a solution. I need different Users in in different Repos.

Thanks for your kind help

The examples there doesn’t contain a user section, yes, but you can still use it the same way (see the example in my previous post), no matter if it’s in a repository config or global config.

If editing the config file feels too complicated you can just use the git config command directly, which will adjust the config file automatically:

git config Your Name
git config

git config changes the the repository configuration by default.

1 Like

The last sentence was great!

Thanks for your kind Help

1 Like