Documentation / git-check-ref-format.txton commit Documentation: asciidoc formatting fix for git-cvsexportcommit doc. (79f6ac7)
   1git-check-ref-format(1)
   2=======================
   3
   4NAME
   5----
   6git-check-ref-format - Make sure ref name is well formed.
   7
   8SYNOPSIS
   9--------
  10'git-check-ref-format' <refname>
  11
  12DESCRIPTION
  13-----------
  14Checks if a given 'refname' is acceptable, and exits non-zero if
  15it is not.
  16
  17A reference is used in git to specify branches and tags.  A
  18branch head is stored under `$GIT_DIR/refs/heads` directory, and
  19a tag is stored under `$GIT_DIR/refs/tags` directory.  git
  20imposes 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 `~`,
  29  caret `{caret}`, or colon `:` anywhere;
  30
  31. It cannot end with a slash `/`.
  32
  33These rules makes it easy for shell script based tools to parse
  34refnames, and also avoids ambiguities in certain refname
  35expressions (see gitlink:git-rev-parse[1]).  Namely:
  36
  37. double-dot `..` are often used as in `ref1..ref2`, and in some
  38  context this notation means `{caret}ref1 ref2` (i.e. not in
  39  ref1 and in ref2).
  40
  41. tilde `~` and caret `{caret}` are used to introduce postfix
  42  'nth parent' and 'peel onion' operation.
  43
  44. colon `:` is used as in `srcref:dstref` to mean "use srcref\'s
  45  value and store it in dstref" in fetch and push operations.
  46
  47
  48GIT
  49---
  50Part of the gitlink:git[7] suite