Autogenerated man pages for 36de72aa9dc3b7daf8cf2770c840f39bb0d2ae70
[git.git] / man1 / git-repo-config.1
1 .\"Generated by db2man.xsl. Don't modify this, modify the source.
2 .de Sh \" Subsection
3 .br
4 .if t .Sp
5 .ne 5
6 .PP
7 \fB\\$1\fR
8 .PP
9 ..
10 .de Sp \" Vertical space (when we can't use .PP)
11 .if t .sp .5v
12 .if n .sp
13 ..
14 .de Ip \" List item
15 .br
16 .ie \\n(.$>=3 .ne \\$3
17 .el .ne 3
18 .IP "\\$1" \\$2
19 ..
20 .TH "GIT-REPO-CONFIG" 1 "" "" ""
21 .SH NAME
22 git-repo-config \- Get and set options in .git/config.
23 .SH "SYNOPSIS"
24
25
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]
27
28 .SH "DESCRIPTION"
29
30
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\&.
32
33
34 If you want to set/unset an option which can occor 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 exlamation mark in front (see EXAMPLES)\&.
35
36
37 This command will fail if
38
39 .TP 3
40 1.
41 \&.git/config is invalid,
42 .TP
43 2.
44 \&.git/config can not be written to,
45 .TP
46 3.
47 no section was provided,
48 .TP
49 4.
50 the section or key is invalid,
51 .TP
52 5.
53 you try to unset an option which does not exist, or
54 .TP
55 6.
56 you try to unset/set an option for which multiple lines match\&.
57 .LP
58
59 .SH "OPTIONS"
60
61 .TP
62 \-\-replace\-all
63 Default behaviour is to replace at most one line\&. This replaces all lines matching the key (and optionally the value_regex)
64
65 .TP
66 \-\-get
67 Get the value for a given key (optionally filtered by a regex matching the value)\&.
68
69 .TP
70 \-\-get\-all
71 Like get, but does not fail if the number of values for the key is not exactly one\&.
72
73 .TP
74 \-\-unset
75 Remove the line matching the key from \&.git/config\&.
76
77 .TP
78 \-\-unset\-all
79 Remove all matching lines from \&.git/config\&.
80
81 .SH "EXAMPLE"
82
83
84 Given a \&.git/config like this:
85
86 .nf
87 #
88 # This is the config file, and
89 # a '#' or ';' character indicates
90 # a comment
91 #
92 .fi
93
94 .nf
95 ; core variables
96 [core]
97         ; Don't trust file modes
98         filemode = false
99 .fi
100
101 .nf
102 ; Our diff algorithm
103 [diff]
104         external = "/usr/local/bin/gnu\-diff \-u"
105         renames = true
106 .fi
107
108 .nf
109 ; Proxy settings
110 [proxy]
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
115 .fi
116
117
118 you can set the filemode to true with
119
120 .IP
121 % git repo\-config core\&.filemode true
122
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"\&.
124
125 .IP
126 % git repo\-config proxy\&.command '"ssh" for kernel\&.org' 'for kernel\&.org$'
127
128 This makes sure that only the key/value pair for kernel\&.org is replaced\&.
129
130
131 To delete the entry for renames, do
132
133 .IP
134 % git repo\-config \-\-unset diff\&.renames
135
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\&.
137
138
139 To query the value for a given key, do
140
141 .IP
142 % git repo\-config \-\-get core\&.filemode
143
144 or
145
146 .IP
147 % git repo\-config core\&.filemode
148
149 or, to query a multivar:
150
151 .IP
152 % git repo\-config \-\-get proxy\&.command "for kernel\&.org$"
153
154 If you want to know all the values for a multivar, do:
155
156 .IP
157 % git repo\-config \-\-get\-all proxy\&.command
158
159 If you like to live dangerous, you can replace all proxy\&.commands by a new one with
160
161 .IP
162 % git repo\-config \-\-replace\-all proxy\&.command ssh
163
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:
165
166 .IP
167 % git repo\-config proxy\&.command ssh '! for '
168
169 To actually match only values with an exclamation mark, you have to
170
171 .IP
172 % git repo\-config section\&.key value '[!]'
173 .SH "AUTHOR"
174
175
176 Written by Johannes Schindelin <Johannes\&.Schindelin@gmx\&.de>
177
178 .SH "DOCUMENTATION"
179
180
181 Documentation by Johannes Schindelin\&.
182
183 .SH "GIT"
184
185
186 Part of the \fBgit\fR(7) suite
187