1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
10 .de Sp \" Vertical space (when we can't use .PP)
16 .ie \\n(.$>=3 .ne \\$3
20 .TH "GIT-REPO-CONFIG" 1 "" "" ""
22 git-repo-config \- Get and set options in .git/config.
26 git\-repo\-config name [value [value_regex]] git\-repo\-config \-\-replace\-all name [value [value_regex]] git\-repo\-config \-\-get name [value_regex] git\-repo\-config \-\-get\-all name [value_regex] git\-repo\-config \-\-unset name [value_regex] git\-repo\-config \-\-unset\-all name [value_regex]
31 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\&.
34 If you want to set/unset an option which can occur on multiple lines, you should provide a POSIX regex for the value\&. If you want to handle the lines not matching the regex, just prepend a single exclamation mark in front (see EXAMPLES)\&.
37 This command will fail if
41 \&.git/config is invalid,
44 \&.git/config can not be written to,
47 no section was provided,
50 the section or key is invalid,
53 you try to unset an option which does not exist, or
56 you try to unset/set an option for which multiple lines match\&.
63 Default behaviour is to replace at most one line\&. This replaces all lines matching the key (and optionally the value_regex)
67 Get the value for a given key (optionally filtered by a regex matching the value)\&.
71 Like get, but does not fail if the number of values for the key is not exactly one\&.
75 Remove the line matching the key from \&.git/config\&.
79 Remove all matching lines from \&.git/config\&.
84 Given a \&.git/config like this:
88 # This is the config file, and
89 # a '#' or ';' character indicates
97 ; Don't trust file modes
104 external = "/usr/local/bin/gnu\-diff \-u"
111 command="ssh" for "ssh://kernel\&.org/"
112 command="proxy\-command" for kernel\&.org
113 command="myprotocol\-command" for "my://"
114 command=default\-proxy ; for all the rest
118 you can set the filemode to true with
121 % git repo\-config core\&.filemode true
123 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"\&.
126 % git repo\-config proxy\&.command '"ssh" for kernel\&.org' 'for kernel\&.org$'
128 This makes sure that only the key/value pair for kernel\&.org is replaced\&.
131 To delete the entry for renames, do
134 % git repo\-config \-\-unset diff\&.renames
136 If you want to delete an entry for a multivar (like proxy\&.command above), you have to provide a regex matching the value of exactly one line\&.
139 To query the value for a given key, do
142 % git repo\-config \-\-get core\&.filemode
147 % git repo\-config core\&.filemode
149 or, to query a multivar:
152 % git repo\-config \-\-get proxy\&.command "for kernel\&.org$"
154 If you want to know all the values for a multivar, do:
157 % git repo\-config \-\-get\-all proxy\&.command
159 If you like to live dangerous, you can replace all proxy\&.commands by a new one with
162 % git repo\-config \-\-replace\-all proxy\&.command ssh
164 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:
167 % git repo\-config proxy\&.command ssh '! for '
169 To actually match only values with an exclamation mark, you have to
172 % git repo\-config section\&.key value '[!]'
176 Written by Johannes Schindelin <Johannes\&.Schindelin@gmx\&.de>
181 Documentation by Johannes Schindelin\&.
186 Part of the \fBgit\fR(7) suite