I initialized a remote ssh repo using git init --bare
and added the following post-receive
hooks
#!/bin/sh
dest=/home/git/api
rm -rf $dest
mkdir -p $dest
GIT_WORK_TREE=$dest
git checkout --force
The problem is i keep getting error
remote: fatal: This operation must be run in a work tree
I don't understand this error where am i going wrong ?