2005-11-24 11:36:01 +01:00
|
|
|
git-repo-config(1)
|
|
|
|
==================
|
2005-11-17 22:49:19 +01:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2006-11-02 16:44:20 +01:00
|
|
|
git-repo-config - Get and set repository or global options.
|
2005-11-17 22:49:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2006-03-02 17:10:49 +01:00
|
|
|
[verse]
|
2006-11-02 16:44:20 +01:00
|
|
|
'git-repo-config' [--global] [type] name [value [value_regex]]
|
|
|
|
'git-repo-config' [--global] [type] --replace-all name [value [value_regex]]
|
|
|
|
'git-repo-config' [--global] [type] --get name [value_regex]
|
|
|
|
'git-repo-config' [--global] [type] --get-all name [value_regex]
|
|
|
|
'git-repo-config' [--global] [type] --unset name [value_regex]
|
|
|
|
'git-repo-config' [--global] [type] --unset-all name [value_regex]
|
|
|
|
'git-repo-config' [--global] -l | --list
|
2005-11-17 22:49:19 +01:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2005-11-20 06:52:22 +01:00
|
|
|
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.
|
2005-11-17 22:49:19 +01:00
|
|
|
|
2006-05-08 00:32:51 +02:00
|
|
|
If you want to set/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 EXAMPLES).
|
2005-11-17 22:49:19 +01:00
|
|
|
|
2006-02-12 04:14:48 +01:00
|
|
|
The type specifier can be either '--int' or '--bool', which will make
|
|
|
|
'git-repo-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). If no type specifier is passed,
|
|
|
|
no checks or transformations are performed on the value.
|
|
|
|
|
2006-05-05 21:05:10 +02:00
|
|
|
This command will fail if:
|
2005-11-17 22:49:19 +01:00
|
|
|
|
2006-05-05 21:05:10 +02:00
|
|
|
. The .git/config file is invalid,
|
|
|
|
. Can not write to .git/config,
|
2005-11-17 22:49:19 +01:00
|
|
|
. no section was provided,
|
|
|
|
. the section or key is invalid,
|
2006-11-02 16:44:20 +01:00
|
|
|
. you try to unset an option which does not exist,
|
|
|
|
. you try to unset/set an option for which multiple lines match, or
|
|
|
|
. you use --global option without $HOME being properly set.
|
2005-11-17 22:49:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
|
2005-11-20 06:52:22 +01:00
|
|
|
--replace-all::
|
2006-06-03 22:27:26 +02:00
|
|
|
Default behavior is to replace at most one line. This replaces
|
2006-05-02 14:22:48 +02:00
|
|
|
all lines matching the key (and optionally the value_regex).
|
2005-11-20 06:52:22 +01:00
|
|
|
|
|
|
|
--get::
|
|
|
|
Get the value for a given key (optionally filtered by a regex
|
2006-07-03 22:47:55 +02:00
|
|
|
matching the value). Returns error code 1 if the key was not
|
|
|
|
found and error code 2 if multiple key values were found.
|
2005-11-20 06:52:22 +01:00
|
|
|
|
|
|
|
--get-all::
|
|
|
|
Like get, but does not fail if the number of values for the key
|
|
|
|
is not exactly one.
|
|
|
|
|
2006-05-02 14:22:48 +02:00
|
|
|
--get-regexp::
|
|
|
|
Like --get-all, but interprets the name as a regular expression.
|
|
|
|
|
2006-11-02 16:44:20 +01:00
|
|
|
--global::
|
|
|
|
Use global ~/.gitconfig file rather than the repository .git/config.
|
|
|
|
|
2005-11-17 22:49:19 +01:00
|
|
|
--unset::
|
2006-11-02 16:44:20 +01:00
|
|
|
Remove the line matching the key from config file.
|
2005-11-20 06:52:22 +01:00
|
|
|
|
|
|
|
--unset-all::
|
2006-11-02 16:44:20 +01:00
|
|
|
Remove all matching lines from config file.
|
2005-11-17 22:49:19 +01:00
|
|
|
|
2006-04-25 00:59:25 +02:00
|
|
|
-l, --list::
|
2006-11-02 16:44:20 +01:00
|
|
|
List all variables set in config file.
|
2006-04-25 00:59:25 +02:00
|
|
|
|
2006-11-29 09:25:40 +01:00
|
|
|
--bool::
|
|
|
|
git-repo-config will ensure that the output is "true" or "false"
|
|
|
|
|
|
|
|
--int::
|
|
|
|
git-repo-config will ensure that the output is a simple decimal number
|
|
|
|
|
2005-11-17 22:49:19 +01:00
|
|
|
|
2006-06-18 01:23:58 +02:00
|
|
|
ENVIRONMENT
|
|
|
|
-----------
|
|
|
|
|
|
|
|
GIT_CONFIG::
|
|
|
|
Take the configuration from the given file instead of .git/config.
|
2006-11-02 16:44:20 +01:00
|
|
|
Using the "--global" option forces this to ~/.gitconfig.
|
2006-06-18 01:23:58 +02:00
|
|
|
|
|
|
|
GIT_CONFIG_LOCAL::
|
|
|
|
Currently the same as $GIT_CONFIG; when Git will support global
|
|
|
|
configuration files, this will cause it to take the configuration
|
|
|
|
from the global configuration file in addition to the given file.
|
|
|
|
|
|
|
|
|
2005-11-17 22:49:19 +01:00
|
|
|
EXAMPLE
|
|
|
|
-------
|
|
|
|
|
|
|
|
Given a .git/config like this:
|
|
|
|
|
|
|
|
#
|
|
|
|
# This is the config file, and
|
|
|
|
# a '#' or ';' character indicates
|
|
|
|
# a comment
|
|
|
|
#
|
|
|
|
|
|
|
|
; core variables
|
|
|
|
[core]
|
|
|
|
; Don't trust file modes
|
|
|
|
filemode = false
|
|
|
|
|
|
|
|
; Our diff algorithm
|
|
|
|
[diff]
|
|
|
|
external = "/usr/local/bin/gnu-diff -u"
|
|
|
|
renames = true
|
|
|
|
|
|
|
|
; Proxy settings
|
2006-04-25 00:59:33 +02:00
|
|
|
[core]
|
|
|
|
gitproxy="ssh" for "ssh://kernel.org/"
|
|
|
|
gitproxy="proxy-command" for kernel.org
|
|
|
|
gitproxy="myprotocol-command" for "my://"
|
|
|
|
gitproxy=default-proxy ; for all the rest
|
2005-11-17 22:49:19 +01:00
|
|
|
|
|
|
|
you can set the filemode to true with
|
|
|
|
|
|
|
|
------------
|
2005-11-24 11:36:01 +01:00
|
|
|
% git repo-config core.filemode true
|
2005-11-17 22:49:19 +01:00
|
|
|
------------
|
|
|
|
|
2006-07-09 09:44:30 +02:00
|
|
|
The hypothetical proxy command entries actually have a postfix to discern
|
|
|
|
what URL they apply to. Here is how to change the entry for kernel.org
|
2005-11-17 22:49:19 +01:00
|
|
|
to "ssh".
|
|
|
|
|
|
|
|
------------
|
2006-04-25 00:59:33 +02:00
|
|
|
% git repo-config core.gitproxy '"ssh" for kernel.org' 'for kernel.org$'
|
2005-11-17 22:49:19 +01:00
|
|
|
------------
|
|
|
|
|
|
|
|
This makes sure that only the key/value pair for kernel.org is replaced.
|
|
|
|
|
|
|
|
To delete the entry for renames, do
|
|
|
|
|
|
|
|
------------
|
2005-11-24 11:36:01 +01:00
|
|
|
% git repo-config --unset diff.renames
|
2005-11-17 22:49:19 +01:00
|
|
|
------------
|
|
|
|
|
2006-04-25 00:59:33 +02:00
|
|
|
If you want to delete an entry for a multivar (like core.gitproxy above),
|
2005-11-20 06:52:22 +01:00
|
|
|
you have to provide a regex matching the value of exactly one line.
|
|
|
|
|
|
|
|
To query the value for a given key, do
|
2005-11-17 22:49:19 +01:00
|
|
|
|
|
|
|
------------
|
2005-11-24 11:36:01 +01:00
|
|
|
% git repo-config --get core.filemode
|
2005-11-17 22:49:19 +01:00
|
|
|
------------
|
|
|
|
|
2005-11-20 06:52:22 +01:00
|
|
|
or
|
|
|
|
|
|
|
|
------------
|
2005-11-24 11:36:01 +01:00
|
|
|
% git repo-config core.filemode
|
2005-11-20 06:52:22 +01:00
|
|
|
------------
|
|
|
|
|
|
|
|
or, to query a multivar:
|
|
|
|
|
|
|
|
------------
|
2006-04-25 00:59:33 +02:00
|
|
|
% git repo-config --get core.gitproxy "for kernel.org$"
|
2005-11-20 06:52:22 +01:00
|
|
|
------------
|
|
|
|
|
|
|
|
If you want to know all the values for a multivar, do:
|
|
|
|
|
|
|
|
------------
|
2006-04-25 00:59:33 +02:00
|
|
|
% git repo-config --get-all core.gitproxy
|
2005-11-20 06:52:22 +01:00
|
|
|
------------
|
|
|
|
|
2006-04-25 00:59:33 +02:00
|
|
|
If you like to live dangerous, you can replace *all* core.gitproxy by a
|
2005-11-20 06:52:22 +01:00
|
|
|
new one with
|
|
|
|
|
|
|
|
------------
|
2006-04-25 00:59:33 +02:00
|
|
|
% git repo-config --replace-all core.gitproxy ssh
|
2005-11-20 06:52:22 +01:00
|
|
|
------------
|
2005-11-17 22:49:19 +01:00
|
|
|
|
2005-11-20 13:24:18 +01:00
|
|
|
However, if you really only want to replace the line for the default proxy,
|
|
|
|
i.e. the one without a "for ..." postfix, do something like this:
|
|
|
|
|
|
|
|
------------
|
2006-04-25 00:59:33 +02:00
|
|
|
% git repo-config core.gitproxy ssh '! for '
|
2005-11-20 13:24:18 +01:00
|
|
|
------------
|
|
|
|
|
|
|
|
To actually match only values with an exclamation mark, you have to
|
|
|
|
|
|
|
|
------------
|
2005-11-24 11:36:01 +01:00
|
|
|
% git repo-config section.key value '[!]'
|
2005-11-20 13:24:18 +01:00
|
|
|
------------
|
|
|
|
|
2005-11-17 22:49:19 +01:00
|
|
|
|
2006-04-25 00:59:33 +02:00
|
|
|
include::config.txt[]
|
|
|
|
|
|
|
|
|
2005-11-17 22:49:19 +01:00
|
|
|
Author
|
|
|
|
------
|
|
|
|
Written by Johannes Schindelin <Johannes.Schindelin@gmx.de>
|
|
|
|
|
|
|
|
Documentation
|
|
|
|
--------------
|
2006-04-25 00:59:33 +02:00
|
|
|
Documentation by Johannes Schindelin, Petr Baudis and the git-list <git@vger.kernel.org>.
|
2005-11-17 22:49:19 +01:00
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
|
|
|
Part of the gitlink:git[7] suite
|
|
|
|
|