I have a website server with git to which I have ssh access. I can pull to any folder above the public_html but the provider does not want to host git repositories so I cannot push to it.

The question is: what is the most convenient way of deploying and managing a website with git in this situation?

I do not think that an init in public_html is a good idea?

  • Buy your own server if you want freedom. It isn't called 'shared' hosting for nothing.
    – William
    Commented Sep 19, 2014 at 15:03

1 Answer 1


You do this via git hooks. You can configure your git hosting service (bitbucket or github) to call a url everytime you do a git push. In essence you commit them push your changes to github/bitbucket and then those services do a request on a specific filename on your webserver.

In my scenario I have bitbucket always call http://www.mydomain.com/git-update.asp and then git-update.asp actually runs a cmd prompt and does a git pull.

If you are on linux based server its a little bit easier via php. Check out this gist for more information: https://gist.github.com/oodavid/1809044

If you are on a windows IIS server let me know and I will see if its cool for us to share our git deployment for windows code publicly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.