【问题标题】:Executing a git-hook after pull --rebasepull --rebase 后执行 git-hook
【发布时间】:2017-01-02 01:24:18
【问题描述】:

我想在执行git pull --rebase 之后运行一个挂钩,以检查某个文件是否已更改。类似于 this 钩子的东西。

我最初考虑使用 post-rewrite 钩子,但是它只在提交被重写时有效,并且当 pull 操作只是快进分支时不会运行,这很常见。

任何想法都会受到赞赏。

【问题讨论】:

    标签: git git-rebase githooks git-pull


    【解决方案1】:

    我在本地存储库上运行了strace git pull --rebase,它执行了快进更新...

    First, rewinding head to replay your work on top of it...
    Fast-forwarded master to b0a60c3302973ca1878d149d61f2f612c8f27fac.
    

    ...看起来git 在这种情况下调用了post-checkout 钩子:

    【讨论】:

      猜你喜欢
      • 2021-11-17
      • 2017-12-07
      • 1970-01-01
      • 2021-08-16
      • 2011-09-11
      • 2013-03-14
      • 2014-02-17
      • 2012-06-10
      • 2018-08-02
      相关资源
      最近更新 更多