gpt4 book ai didi

git - 分支名称中哪些字符是非法的?

转载 作者:IT王子 更新时间:2023-10-29 01:14:33 25 4
gpt4 key购买 nike

分支名称中哪些字符是非法的?

最佳答案

refname 的命名规则:

Git imposes the following rules on how references are named:

  1. They can include slash / for hierarchical (directory) grouping, but no slash-separated component can begin with a dot . or end with the sequence .lock.

  2. They must contain at least one /. This enforces the presence of a category like heads/, tags/ etc. but the actual names are not restricted. If the --allow-onelevel option is used, this rule is waived.

  3. They cannot have two consecutive dots .. anywhere.

  4. They cannot have ASCII control characters (i.e. bytes whose values are lower than \040, or \177 DEL), space, tilde ~, caret ^, or colon : anywhere.

  5. They cannot have question-mark ?, asterisk *, or open bracket [ anywhere. See the --refspec-pattern option below for an exception to this rule.

  6. They cannot begin or end with a slash / or contain multiple consecutive slashes (see the --normalize option below for an exception to this rule)

  7. They cannot end with a dot .

  8. They cannot contain a sequence @{.

  9. They cannot be the single character @.

  10. They cannot contain a \.

最重要的是,分支名称的附加规则:

  1. They cannot start with a dash -

感谢Jakub Narębski , man page git check-ref-format 有更多细节。

关于git - 分支名称中哪些字符是非法的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3651860/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com