gitgithooksgit-pullgit-post-receive

git pull in hooks/post-receive failed


On the server, /home/git/xxx/hooks/post-receive:

#!/bin/bash

cd /var/www/xxx
git pull

On the server, /var/www/xxx was created like this:

cd /var/www
git clone /home/git/repositories/xxx.git

When I run "git push" on the client, got this message:

remote: fatal: Not a git repository: '.'

Any ideas?


Solution

  • Per your comment, you want to automatically update a website when changes are pushed to a Git repository. Try this: http://www.ekynoxe.com/automated-deployment-on-remote-server-with-git/

    Note that the website root directory (/var/www/xxx) is not a Git repository itself; it just holds the working tree.