@matheusbsbs / matheus-bagliano / commits / 2d2465c015
Fork 0

Add documentation for git-config-set

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Nov 17, 2005 at 22:49 UTC 2d2465c01518eb7defa9aa39ae864c9646cfb6f4
2 files changed +111
Documentation/git-config-set.txt new
+108
@@ -0,0 +1,108 @@
1 +git-config-set(1)
2 +===============
3 +
4 +NAME
5 +----
6 +git-config-set - Set options in .git/config.
7 +
8 +
9 +SYNOPSIS
10 +--------
11 +'git-config-set' ( name [value [value_regex]] | --unset name [value_regex] )
12 +
13 +DESCRIPTION
14 +-----------
15 +You can set/replace/unset options with this command. The name is actually
16 +the section and the key separated by a dot, and the value will be escaped.
17 +
18 +If you want to set/unset an option which can occor on multiple lines, you
19 +should provide a POSIX regex for the value.
20 +
21 +This 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 +
31 +OPTIONS
32 +-------
33 +
34 +--unset::
35 + Remove the given option from .git/config
36 +
37 +
38 +EXAMPLE
39 +-------
40 +
41 +Given 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 +
65 +you can set the filemode to true with
66 +
67 +------------
68 +% git config-set core.filemode true
69 +------------
70 +
71 +The hypothetic proxy command entries actually have a postfix to discern
72 +to what URL they apply. Here is how to change the entry for kernel.org
73 +to "ssh".
74 +
75 +------------
76 +% git config-set proxy.command '"ssh" for kernel.org' 'for kernel.org$'
77 +------------
78 +
79 +This makes sure that only the key/value pair for kernel.org is replaced.
80 +
81 +To delete the entry for renames, do
82 +
83 +------------
84 +% git config-set --unset diff.renames
85 +------------
86 +
87 +or just
88 +
89 +------------
90 +% git config-set diff.renames
91 +------------
92 +
93 +If you want to delete an entry for a multivar (like proxy.command above),
94 +you have to provide a regex matching the value of exactly one line.
95 +
96 +
97 +Author
98 +------
99 +Written by Johannes Schindelin <Johannes.Schindelin@gmx.de>
100 +
101 +Documentation
102 +--------------
103 +Documentation by Johannes Schindelin.
104 +
105 +GIT
106 +---
107 +Part of the gitlink:git[7] suite
108 +
Documentation/git.txt
+3
@@ -84,6 +84,9 @@ gitlink:git-checkout-index[1]::
84 gitlink:git-commit-tree[1]::
85 Creates a new commit object
86
87 +gitlink:git-config-set[1]::
88 + Set options in .git/config.
89 +
90 gitlink:git-hash-object[1]::
91 Computes the object ID from a file.
92