1GIT-CHECK-REF-FOR(1) Git Manual GIT-CHECK-REF-FOR(1)
2
3
4
6 git-check-ref-format - Make sure ref name is well formed
7
9 git-check-ref-format <refname>
10
12 Checks if a given refname is acceptable, and exits non-zero if it is
13 not.
14
15 A reference is used in git to specify branches and tags. A branch head
16 is stored under $GIT_DIR/refs/heads directory, and a tag is stored
17 under $GIT_DIR/refs/tags directory. git imposes the following rules on
18 how refs are named:
19
20
21 1. It can include slash / for hierarchical (directory) grouping, but
22 no slash-separated component can begin with a dot .;
23
24 2. It cannot have two consecutive dots .. anywhere;
25
26 3. It cannot have ASCII control character (i.e. bytes whose values
27 are lower than \040, or \177 DEL), space, tilde ~, caret ^, colon
28 :, question-mark ?, asterisk *, or open bracket [ anywhere;
29
30 4. It cannot end with a slash /.
31 These rules makes it easy for shell script based tools to parse
32 refnames, pathname expansion by the shell when a refname is used
33 unquoted (by mistake), and also avoids ambiguities in certain refname
34 expressions (see git-rev-parse(1)). Namely:
35
36
37 1. double-dot .. are often used as in ref1..ref2, and in some context
38 this notation means ^ref1 ref2 (i.e. not in ref1 and in ref2).
39
40 2. tilde ~ and caret ^ are used to introduce postfix nth parent and
41 peel onion operation.
42
43 3. colon : is used as in srcref:dstref to mean "use srcref´s value
44 and store it in dstref" in fetch and push operations. It may also
45 be used to select a specific object such as with git-cat-file(1)
46 "git-cat-file blob v1.3.3:refs.c".
47
49 Part of the git(7) suite
50
51
52
53
54Git 1.5.3.3 10/09/2007 GIT-CHECK-REF-FOR(1)