I have been working on a Kohana 3 project that I installed using the downloaded zip file awhile ago. I have a git repository on my remote server "project.git" which checks out the latest commits to the working directory "public_html" where I test the application
My post-receive hook file
GIT_WORK_TREE=/var/www/public_html;
git checkout -f;
which was working for a couple of months until I decided to remove some kohana folders and use git submodule instead, so I can do updates via git.
Now the problem is that the submodules are not in the working directory. I tried going in there to add the submodules but the "public_html" directory isn't a repository. In the "project.git" directory, git commands throw an error that I must perform them in the working directory.
How do I modify my hook to checkout submodules when I do a commit?
Update
As per @manojlds's suggestion: I added it to the hook and now it looks like this:
GIT_WORK_TREE=/var/www/public_html;
git submodule init;
git submodule update;
git checkout -f;
But I get this message,
remote: You need to run this command from the Top level of the working tree
and no changes to the submodules in
public_html