3b7ee778446b464544d60bcd8afdf7e997f31136
[git.git] / man1 / git-check-ref-format.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-CHECK-REF-FORM" 1 "" "" ""
21 .SH NAME
22 git-check-ref-format \- Make sure ref name is well formed.
23 .SH "SYNOPSIS"
24
25
26 git\-check\-ref\-format <refname>
27
28 .SH "DESCRIPTION"
29
30
31 Checks if a given refname is acceptable, and exits non\-zero if it is not\&.
32
33
34 A reference is used in git to specify branches and tags\&. A branch head is stored under $GIT_DIR/refs/heads directory, and a tag is stored under $GIT_DIR/refs/tags directory\&. git imposes the following rules on how refs are named:
35
36 .TP 3
37 1.
38 It could be named hierarchically (i\&.e\&. separated with slash /), but each of its component cannot begin with a dot \&.;
39 .TP
40 2.
41 It cannot have two consecutive dots \&.\&. anywhere;
42 .TP
43 3.
44 It cannot have ASCII control character (i\&.e\&. bytes whose values are lower than \\040, or \\177 DEL), space, tilde ~, caret ^, colon :, question\-mark ?, asterisk *, or open bracket [ anywhere;
45 .TP
46 4.
47 It cannot end with a slash /\&.
48 .LP
49
50
51 These rules makes it easy for shell script based tools to parse refnames, pathname expansion by the shell when a refname is used unquoted (by mistake), and also avoids ambiguities in certain refname expressions (see \fBgit\-rev\-parse\fR(1))\&. Namely:
52
53 .TP 3
54 1.
55 double\-dot \&.\&. are often used as in ref1\&.\&.ref2, and in some context this notation means ^ref1 ref2 (i\&.e\&. not in ref1 and in ref2)\&.
56 .TP
57 2.
58 tilde ~ and caret ^ are used to introduce postfix nth parent and peel onion operation\&.
59 .TP
60 3.
61 colon : is used as in srcref:dstref to mean "use srcref's value and store it in dstref" in fetch and push operations\&.
62 .LP
63
64 .SH "GIT"
65
66
67 Part of the \fBgit\fR(7) suite
68