Hongmu Notes

git check-ref-format

Check whether the reference name format is legal, and return a non-zero status if it is not legal.

100% Browser local processing 0 Data upload

Common examples

Check whether the format of the specified reference name is legal

git check-ref-format {{refs/head/refname}}

Print the most recently checked out branch name

git check-ref-format --branch @{-1}

Normalized reference name format

git check-ref-format --normalize {{refs/head/refname}}

Tip: curly braces{{…}}It is the parameter that needs to be replaced (path, file name, etc.); the command is only executed in the local terminal, and this site does not save any input.

English original text comparison

Expand English instructions and examples (source tldr-pages)

Check if a reference name is acceptable, and exit with a non-zero status if it is not. More information

Check the format of the specified reference name

git check-ref-format {{refs/head/refname}}

Print the name of the last branch checked out

git check-ref-format --branch @{-1}

Normalize a refname

git check-ref-format --normalize {{refs/head/refname}}

command information

command namegit check-ref-format
PurposeCheck whether the reference name format is legal, and return a non-zero status if it is not legal.
Applicable platforms通用
Number of examples3 Article
Official documentationhttps://git-scm.com/docs/git-check-ref-format
Data sourcetldr-pages(CC-BY-4.0)· Community Chinese Translation

FAQ

git check-ref-format What does the command do?

Check whether the reference name format is legal, and return a non-zero status if it is not legal.

git check-ref-format How to use it?

Pages listed by scene3Commonly used examples: Each example first explains the purpose, and then gives a complete command that can be directly copied (the parameters that need to be replaced are in the curly brackets).

git check-ref-format What are the most commonly used operations?

Check whether the format of the specified reference name is legal:git check-ref-format {{refs/head/refname}}

What do the curly braces in the command mean?

curly braces{{…}}Indicates that you need to replace it with your own value, such as path and file name; square brackets for parameters with the same name (such as[-C|--directory]) indicates optional writing.