On the server I have bare repository which is origin for development process and to simplify deployment to QA environment.
So in post-receive
it simply does
GIT_WORK_TREE=/home/dev git checkout -f
But as product gets more complicated there are some other things should be happening. So now it is handled by deploy.sh
script which is also tracked by repository. So what I want to do is to be able instead of checking out whole repository is to checkout only deploy.sh
and run it. I thought something like that would work:
SOURCE_PATH="/home/dev"
GIT_WORK_TREE=$SOURCE_PATH git checkout deploy.sh
$SOURCE_PATH"/deploy.sh"
But it does not work giving error:
error: pathspec 'deploy.sh' did not match any file(s) known to git.
What am I doing wrong? Or is it just impossible to do this way?