Git submodule commit hooks

后端 未结 2 1362
自闭症患者
自闭症患者 2021-01-03 18:12

I\'m using a git submodule (let\'s call it SubmoduleRepo) so that I can include my module in couple of projects.

I can commit to SubmoduleRepo from any project that

相关标签:
2条回答
  • 2021-01-03 18:51

    I've found solution couple of moments after posting this...

    You can put hooks in .git/modules//hooks/ - eg. .git/modules/web/js/modules/rate if your submodule is located in /web/js/modules/rate directory.

    0 讨论(0)
  • 2021-01-03 19:01

    If you have Git 2.10+ you can get the hooks directory by running:

    `git rev-parse --git-path hooks`
    

    Note: by default it is .git/hooks but if you are in a submodule it will be different.

    Pre Git 2.10+ you would want something like:

    `git rev-parse --git-dir`/hooks
    

    More info at: Find path to git hooks directory on the shell

    0 讨论(0)
提交回复
热议问题