githook to validate newly created branch names

前端 未结 3 668
不思量自难忘°
不思量自难忘° 2021-01-23 07:38

Does anyone know if there\'s a githook that will hook into the creation of a branch in order to reject the branch name before it\'s actually created?

I currently use com

3条回答
  •  野的像风
    2021-01-23 08:18

    There is not (and to some extent it can't be controlled: branch names are transferred across the network during fetch and push, via refspecs, and refspecs are somewhat limited).

    There is a git command, git check-ref-format; its documentation describes what Git allows. (Branch names are simply any reference that starts with refs/heads/.)

提交回复
热议问题