Questions tagged [git-config]

This command allows get and set repository or global options.

You can query/set/replace/unset options with this command. The name is actually the section and the key separated by a dot, and the value will be escaped.

Multiple lines can be added to an option by using the --add option. If you want to update or unset an option which can occur on multiple lines, a POSIX regexp value_regex needs to be given. Only the existing values that match the regexp are updated or unset. If you want to handle the lines that do not match the regex, just prepend a single exclamation mark in front (see also [EXAMPLES]).

The type specifier can be either --int or --bool, to make git config ensure that the variable(s) are of the given type and convert the value to the canonical form (simple decimal number for int, a "true" or "false" string for bool), or --path, which does some path expansion (see --path below). If no type specifier is passed, no checks or transformations are performed on the value.

When reading, the values are read from the system, global and repository local configuration files by default, and options --system, --global, --local and --file can be used to tell the command to read from only that location (see [FILES]).

When writing, the new value is written to the repository local configuration file by default, and options --system, --global, --file can be used to tell the command to write to that location (you can say --local but that is the default).

This command will fail with non-zero status upon error. Some exit codes are:

  • The config file is invalid (ret=3),

  • Can not write to the config file (ret=4),

  • No section or name was provided (ret=2),

  • The section or key is invalid (ret=1),

  • You try to unset an option which does not exist (ret=5),

  • You try to unset/set an option for which multiple lines match (ret=5), or

  • You try to use an invalid regexp (ret=6).

On success, the command returns the exit code 0.

This command allows get and set repository or global options.

635 questions
-2
votes
1 answer

.gitignore does not hide itself, and doesnot hide a file

I have a repository, and the .gitignore is right under the repository. When I do a git status, there's annoying file src/main/resource/git.properties that keeps showing up, and sometimes blocks me from doing a git pull. I searched that .gitignore…
user2751691
  • 401
  • 2
  • 10
  • 32
-3
votes
1 answer

How do I set git fetch --force in git config?

I want every fetch and pull to get tags from origin, replacing local ones if they differ, and delete tags and origin/ branches that are not on origin, so I did this: git config --global fetch.tags true git config --global fetch.force true git config…
H.v.M.
  • 1,348
  • 3
  • 16
  • 42
-3
votes
1 answer

is there any solution for this git problem

git :- error : could not lock config file C:\Program Files\Java\jdk-17\bin permission denied windows
-3
votes
1 answer

how can solve problem the multiple values in bitbucket?

how can solve problem the multiple values in bitbucket? The message that appeared to me warning: user.email has multiple values error: cannot overwrite multiple values with a single value Use a regexp, --add or --replace-all to change…
Aseel
  • 1
  • 3
-4
votes
1 answer

what is codecheck in gitconfig?

I have created several repository in Ubuntu, but when I do: ~/gittest1 ~/gittest2 ~/gittest3 vim ~/.gitconfig I see: user.name = Greatest Programmer user.email = Greatest_programmer@stackoverflow.com color.diff = auto color.status =…
user97662
  • 942
  • 1
  • 10
  • 29
1 2 3
42
43