GIT-CHECK-REF-FORMAT(1) Git Manual GIT-CHECK-REF-FORMAT(1) (NAME) git-check-ref-format - (SYNOPSIS) git check-ref-format [--normalize] [--[no-]allow-onelevel] [--refspec-pattern] git check-ref-format --branch (DESCRIPTION) refname ( ) . . refs/heads refs/tags ( $GIT_DIR/refs/heads $GIT_DIR/refs/tags git gc $GIT_DIR/packed-refs). : 1. / () . .lock . 2. / . heads/ tags/ . --allow-onelevel . 3. .. . 4. ( \040 \177 DEL) () ~ () ^ : . 5. ? * [ . --refspec-pattern . 6. / ( --normalize ). 7. . . 8. @{ . 9. @ . 10. \ . ( ) ( gitrevisions(7) ): 1. .. ref1..ref2 ^ref1 ref2 ( ref1 ref2 ). 2. () ~ () ^ N- (nth parent) (peel onion) . 3. : srcref:dstref (fetch) (push) << srcref dstref>> . git cat-file : "git cat-file blob v1.3.3:refs.c". 4. @{ reflog . --branch ( ). (previous checkout syntax) (detached HEAD) . git check-ref-format --branch $name git check-ref-format refs/heads/$name ( ). --branch << >> @{-n} . @{-1} "git switch" "git checkout" . (porcelains) . << >> N- . (OPTIONS) --allow-onelevel, --no-allow-onelevel ( / ). --no-allow-onelevel . --refspec-pattern (refspec - ). * refspec ( foo/bar*/baz foo/bar*baz/ foo/bar*/baz*). --normalize refname (/) . 0 . (--print --normalize .) (EXAMPLES) o (checked out) : $ git check-ref-format --branch @{-1} o : $ ref=$(git check-ref-format --normalize "refs/heads/$newbranch")|| { echo "we do not like '$newbranch' as a branch name." >&2 ; exit 1 ; } (GIT) git(1) Git 2.55.0 2026-06-29 GIT-CHECK-REF-FORMAT(1)