githook to validate newly created branch names

前端 未结 3 664
不思量自难忘°
不思量自难忘° 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:34

    Seems like you are referring to placing a policy for commits or branch creation. There is a git config command which helps in putting some template in place eg:

    $ git config --global commit.template ~/.template.txt $ git commit

    subject line

    what happened

    [ticket: X]

    # Please enter the commit message .......
    #
    # modified:   lib/test.rb
    #
    ~
    ~
    ".git/COMMIT_EDITMSG"
    

    Sorry if this did not help. Thanks.

提交回复
热议问题