]>
Commit | Line | Data |
---|---|---|
622ef9df JH |
1 | git-check-ref-format(1) |
2 | ======================= | |
3 | ||
4 | NAME | |
5 | ---- | |
6 | git-check-ref-format - Make sure ref name is well formed. | |
7 | ||
8 | SYNOPSIS | |
9 | -------- | |
10 | 'git-check-ref-format' <refname> | |
11 | ||
12 | DESCRIPTION | |
13 | ----------- | |
14 | Checks if a given 'refname' is acceptable, and exits non-zero if | |
15 | it is not. | |
16 | ||
17 | A reference is used in git to specify branches and tags. A | |
18 | branch head is stored under `$GIT_DIR/refs/heads` directory, and | |
19 | a tag is stored under `$GIT_DIR/refs/tags` directory. git | |
20 | imposes the following rules on how refs are named: | |
21 | ||
22 | . It could be named hierarchically (i.e. separated with slash | |
23 | `/`), but each of its component cannot begin with a dot `.`; | |
24 | ||
25 | . It cannot have two consecutive dots `..` anywhere; | |
26 | ||
27 | . It cannot have ASCII control character (i.e. bytes whose | |
28 | values are lower than \040, or \177 `DEL`), space, tilde `~`, | |
68283999 JH |
29 | caret `{caret}`, colon `:`, question-mark `?`, asterisk `*`, |
30 | or open bracket `[` anywhere; | |
622ef9df JH |
31 | |
32 | . It cannot end with a slash `/`. | |
33 | ||
34 | These rules makes it easy for shell script based tools to parse | |
68283999 JH |
35 | refnames, pathname expansion by the shell when a refname is used |
36 | unquoted (by mistake), and also avoids ambiguities in certain | |
37 | refname expressions (see gitlink:git-rev-parse[1]). Namely: | |
622ef9df JH |
38 | |
39 | . double-dot `..` are often used as in `ref1..ref2`, and in some | |
40 | context this notation means `{caret}ref1 ref2` (i.e. not in | |
41 | ref1 and in ref2). | |
42 | ||
43 | . tilde `~` and caret `{caret}` are used to introduce postfix | |
44 | 'nth parent' and 'peel onion' operation. | |
45 | ||
46 | . colon `:` is used as in `srcref:dstref` to mean "use srcref\'s | |
47 | value and store it in dstref" in fetch and push operations. | |
48 | ||
49 | ||
50 | GIT | |
51 | --- | |
52 | Part of the gitlink:git[7] suite |