2

I have set up bare git repository on server and I want to add post-receive hook which will add directory as a worktree and checkout master branch there. The problem is that each time I push my changes and hook is being executed I get an error:

remote: git: 'worktree' is not a git command. See 'git --help'.

The content of hooks/post-receive file is:

git worktree add -f /some/existing/folder/on/server master

When I run the same command from shell it works fine and files are added/updated in specified directory. Git on server is 2.6.1.

Does anyone have a clue?

Thanks.

senx
  • 630
  • 9
  • 18

0 Answers0