git windows post pull

前端 未结 2 461
無奈伤痛
無奈伤痛 2021-01-16 09:18

I have recently converted from svn. My server is under Windows (don\'t blame me, it wasn\'t my choice :}

I have created a repo with two branches \"master\" and \"sta

相关标签:
2条回答
  • 2021-01-16 09:46

    Few points:

    • Make sure you have git.exe on path. Do a where git and you must get something like

      C:\Program Files (x86)\Git\bin\git.exe
      

      If git.cmd is being used ( from C:\Program Files (x86)\Git\cmd\git.cmd ), you have to do call git pull for it to continue execution. I would say add git.exe to path and start using it.

    • Even on Windows, you must have the shebang - #!/bin/sh for the hooks to properly run.

    • If you want a hook to run on pull, you probably want to use the post-merge hook. post-receive and post-update run on remote repos when you push to them.

    0 讨论(0)
  • 2021-01-16 10:04

    git is probably a batch wrapper around the real executable. Use call git pull.

    And those hooks only fire when content is pushed from a remote location, as far as I can tell from the documentation. So they're ignored for pull.

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