Code

Merge branch 'tr/maint-1.6.3-add-p-modeonly-fix' into maint-1.6.3
[git.git] / Documentation / git-check-ref-format.txt
index 171b68377d6604167fde4f5e4266432fa9048345..c1ce26884e73f1599602472ba5032988486cc465 100644 (file)
@@ -7,7 +7,9 @@ git-check-ref-format - Ensures that a reference name is well formed
 
 SYNOPSIS
 --------
+[verse]
 'git check-ref-format' <refname>
+'git check-ref-format' [--branch] <branchname-shorthand>
 
 DESCRIPTION
 -----------
@@ -30,7 +32,11 @@ imposes the following rules on how references are named:
   caret `{caret}`, colon `:`, question-mark `?`, asterisk `*`,
   or open bracket `[` anywhere.
 
-. They cannot end with a slash `/`.
+. They cannot end with a slash `/` nor a dot `.`.
+
+. They cannot end with the sequence `.lock`.
+
+. They cannot contain a sequence `@{`.
 
 These rules make it easy for shell script based tools to parse
 reference names, pathname expansion by the shell when a reference name is used
@@ -49,6 +55,18 @@ reference name expressions (see linkgit:git-rev-parse[1]):
   It may also be used to select a specific object such as with
   'git-cat-file': "git cat-file blob v1.3.3:refs.c".
 
+. at-open-brace `@{` is used as a notation to access a reflog entry.
+
+With the `--branch` option, it expands a branch name shorthand and
+prints the name of the branch the shorthand refers to.
+
+EXAMPLE
+-------
+
+git check-ref-format --branch @{-1}::
+
+Print the name of the previous branch.
+
 
 GIT
 ---