2005-11-24 13:36:01 +03:00
|
|
|
git-repo-config(1)
|
|
|
|
==================
|
2005-11-18 00:49:19 +03:00
|
|
|
|
|
|
|
NAME
|
|
|
|
----
|
2006-03-09 19:24:50 +03:00
|
|
|
git-repo-config - Get and set options in .git/config
|
2005-11-18 00:49:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2006-03-02 19:10:49 +03:00
|
|
|
[verse]
|
2006-02-12 06:14:48 +03:00
|
|
|
'git-repo-config' [type] name [value [value_regex]]
|
|
|
|
'git-repo-config' [type] --replace-all name [value [value_regex]]
|
|
|
|
'git-repo-config' [type] --get name [value_regex]
|
|
|
|
'git-repo-config' [type] --get-all name [value_regex]
|
|
|
|
'git-repo-config' [type] --unset name [value_regex]
|
|
|
|
'git-repo-config' [type] --unset-all name [value_regex]
|
2006-04-25 02:59:25 +04:00
|
|
|
'git-repo-config' -l | --list
|
2005-11-18 00:49:19 +03:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2005-11-20 08:52:22 +03: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-18 00:49:19 +03:00
|
|
|
|
2006-05-08 02:32:51 +04: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-18 00:49:19 +03:00
|
|
|
|
2006-02-12 06:14:48 +03: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 23:05:10 +04:00
|
|
|
This command will fail if:
|
2005-11-18 00:49:19 +03:00
|
|
|
|
2006-05-05 23:05:10 +04:00
|
|
|
. The .git/config file is invalid,
|
|
|
|
. Can not write to .git/config,
|
2005-11-18 00:49:19 +03:00
|
|
|
. no section was provided,
|
|
|
|
. the section or key is invalid,
|
|
|
|
. you try to unset an option which does not exist, or
|
|
|
|
. you try to unset/set an option for which multiple lines match.
|
|
|
|
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
|
2005-11-20 08:52:22 +03:00
|
|
|
--replace-all::
|
|
|
|
Default behaviour is to replace at most one line. This replaces
|
2006-05-02 16:22:48 +04:00
|
|
|
all lines matching the key (and optionally the value_regex).
|
2005-11-20 08:52:22 +03:00
|
|
|
|
|
|
|
--get::
|
|
|
|
Get the value for a given key (optionally filtered by a regex
|
|
|
|
matching the value).
|
|
|
|
|
|
|
|
--get-all::
|
|
|
|
Like get, but does not fail if the number of values for the key
|
|
|
|
is not exactly one.
|
|
|
|
|
2006-05-02 16:22:48 +04:00
|
|
|
--get-regexp::
|
|
|
|
Like --get-all, but interprets the name as a regular expression.
|
|
|
|
|
2005-11-18 00:49:19 +03:00
|
|
|
--unset::
|
2005-11-20 08:52:22 +03:00
|
|
|
Remove the line matching the key from .git/config.
|
|
|
|
|
|
|
|
--unset-all::
|
|
|
|
Remove all matching lines from .git/config.
|
2005-11-18 00:49:19 +03:00
|
|
|
|
2006-04-25 02:59:25 +04:00
|
|
|
-l, --list::
|
|
|
|
List all variables set in .git/config.
|
|
|
|
|
2005-11-18 00:49:19 +03: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 02:59:33 +04: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-18 00:49:19 +03:00
|
|
|
|
|
|
|
you can set the filemode to true with
|
|
|
|
|
|
|
|
------------
|
2005-11-24 13:36:01 +03:00
|
|
|
% git repo-config core.filemode true
|
2005-11-18 00:49:19 +03:00
|
|
|
------------
|
|
|
|
|
|
|
|
The hypothetic proxy command entries actually have a postfix to discern
|
|
|
|
to what URL they apply. Here is how to change the entry for kernel.org
|
|
|
|
to "ssh".
|
|
|
|
|
|
|
|
------------
|
2006-04-25 02:59:33 +04:00
|
|
|
% git repo-config core.gitproxy '"ssh" for kernel.org' 'for kernel.org$'
|
2005-11-18 00:49:19 +03: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 13:36:01 +03:00
|
|
|
% git repo-config --unset diff.renames
|
2005-11-18 00:49:19 +03:00
|
|
|
------------
|
|
|
|
|
2006-04-25 02:59:33 +04:00
|
|
|
If you want to delete an entry for a multivar (like core.gitproxy above),
|
2005-11-20 08:52:22 +03: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-18 00:49:19 +03:00
|
|
|
|
|
|
|
------------
|
2005-11-24 13:36:01 +03:00
|
|
|
% git repo-config --get core.filemode
|
2005-11-18 00:49:19 +03:00
|
|
|
------------
|
|
|
|
|
2005-11-20 08:52:22 +03:00
|
|
|
or
|
|
|
|
|
|
|
|
------------
|
2005-11-24 13:36:01 +03:00
|
|
|
% git repo-config core.filemode
|
2005-11-20 08:52:22 +03:00
|
|
|
------------
|
|
|
|
|
|
|
|
or, to query a multivar:
|
|
|
|
|
|
|
|
------------
|
2006-04-25 02:59:33 +04:00
|
|
|
% git repo-config --get core.gitproxy "for kernel.org$"
|
2005-11-20 08:52:22 +03:00
|
|
|
------------
|
|
|
|
|
|
|
|
If you want to know all the values for a multivar, do:
|
|
|
|
|
|
|
|
------------
|
2006-04-25 02:59:33 +04:00
|
|
|
% git repo-config --get-all core.gitproxy
|
2005-11-20 08:52:22 +03:00
|
|
|
------------
|
|
|
|
|
2006-04-25 02:59:33 +04:00
|
|
|
If you like to live dangerous, you can replace *all* core.gitproxy by a
|
2005-11-20 08:52:22 +03:00
|
|
|
new one with
|
|
|
|
|
|
|
|
------------
|
2006-04-25 02:59:33 +04:00
|
|
|
% git repo-config --replace-all core.gitproxy ssh
|
2005-11-20 08:52:22 +03:00
|
|
|
------------
|
2005-11-18 00:49:19 +03:00
|
|
|
|
2005-11-20 15:24:18 +03: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 02:59:33 +04:00
|
|
|
% git repo-config core.gitproxy ssh '! for '
|
2005-11-20 15:24:18 +03:00
|
|
|
------------
|
|
|
|
|
|
|
|
To actually match only values with an exclamation mark, you have to
|
|
|
|
|
|
|
|
------------
|
2005-11-24 13:36:01 +03:00
|
|
|
% git repo-config section.key value '[!]'
|
2005-11-20 15:24:18 +03:00
|
|
|
------------
|
|
|
|
|
2005-11-18 00:49:19 +03:00
|
|
|
|
2006-04-25 02:59:33 +04:00
|
|
|
include::config.txt[]
|
|
|
|
|
|
|
|
|
2005-11-18 00:49:19 +03:00
|
|
|
Author
|
|
|
|
------
|
|
|
|
Written by Johannes Schindelin <Johannes.Schindelin@gmx.de>
|
|
|
|
|
|
|
|
Documentation
|
|
|
|
--------------
|
2006-04-25 02:59:33 +04:00
|
|
|
Documentation by Johannes Schindelin, Petr Baudis and the git-list <git@vger.kernel.org>.
|
2005-11-18 00:49:19 +03:00
|
|
|
|
|
|
|
GIT
|
|
|
|
---
|
|
|
|
Part of the gitlink:git[7] suite
|
|
|
|
|