]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-config-set.txt
Documentation update for user-relative paths.
[thirdparty/git.git] / Documentation / git-config-set.txt
CommitLineData
2d2465c0
JS
1git-config-set(1)
2===============
3
4NAME
5----
6git-config-set - Set options in .git/config.
7
8
9SYNOPSIS
10--------
11'git-config-set' ( name [value [value_regex]] | --unset name [value_regex] )
12
13DESCRIPTION
14-----------
15You can set/replace/unset options with this command. The name is actually
16the section and the key separated by a dot, and the value will be escaped.
17
18If you want to set/unset an option which can occor on multiple lines, you
19should provide a POSIX regex for the value.
20
21This command will fail if
22
23. .git/config is invalid,
24. .git/config can not be written to,
25. no section was provided,
26. the section or key is invalid,
27. you try to unset an option which does not exist, or
28. you try to unset/set an option for which multiple lines match.
29
30
31OPTIONS
32-------
33
34--unset::
35 Remove the given option from .git/config
36
37
38EXAMPLE
39-------
40
41Given a .git/config like this:
42
43 #
44 # This is the config file, and
45 # a '#' or ';' character indicates
46 # a comment
47 #
48
49 ; core variables
50 [core]
51 ; Don't trust file modes
52 filemode = false
53
54 ; Our diff algorithm
55 [diff]
56 external = "/usr/local/bin/gnu-diff -u"
57 renames = true
58
59 ; Proxy settings
60 [proxy]
61 command="ssh" for "ssh://kernel.org/"
62 command="proxy-command" for kernel.org
63 command="myprotocol-command" for "my://"
64
65you can set the filemode to true with
66
67------------
68% git config-set core.filemode true
69------------
70
71The hypothetic proxy command entries actually have a postfix to discern
72to what URL they apply. Here is how to change the entry for kernel.org
73to "ssh".
74
75------------
76% git config-set proxy.command '"ssh" for kernel.org' 'for kernel.org$'
77------------
78
79This makes sure that only the key/value pair for kernel.org is replaced.
80
81To delete the entry for renames, do
82
83------------
84% git config-set --unset diff.renames
85------------
86
87or just
88
89------------
90% git config-set diff.renames
91------------
92
93If you want to delete an entry for a multivar (like proxy.command above),
94you have to provide a regex matching the value of exactly one line.
95
96
97Author
98------
99Written by Johannes Schindelin <Johannes.Schindelin@gmx.de>
100
101Documentation
102--------------
103Documentation by Johannes Schindelin.
104
105GIT
106---
107Part of the gitlink:git[7] suite
108