New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Help with Spock and .git repo above webroot

Peter Emil van den Berg March 25, 2019 by Peter Emil van den Berg

Like Jeremy Saxton in https://statamic.com/forum/2744-git-and-spock I have my git repo set up above root on the production server, so like this

  • silbersee.git
  • public_html
    • [files for website]

In the post-receive hook I inserted the working tree

#!/bin/sh
GIT_WORK_TREE=/home/deb81801/domains/silbersee.com/public_html git checkout -f

But changes made using the CP give following log error

[2019-03-25 16:38:26] production.ERROR: Spock command exited unsuccessfully:
Command: git add /home/deb81801/domains/silbersee.com/public_html/site/content/pages/10.spock-test-page/en.index.md
Output: No output
Error:
fatal: Not a git repository (or any of the parent directories): .git

Where do I insert the GIT_WORK_TREE in Spocks settings so Spock knows where to commit?

Answered by Jack McDade!
>>>>>>> Answered <<<<<<<
26 Replies
5 Followers