Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

andreasb's avatar

How to deploy a local git repo to a remote server?

Hi there

I am managing my code with Git on my local machine - I dont want to use GitHub or similar services. Now I want to clone and push this repo onto my webserver (where git is also running).

I created the repo on the webserver using git init but when I try to git clone ssh://server.com/path/to/repo.git git tells me it cannot find my current working directory (?).

When searching for tutorials I always find ones which download the repo from the local mashine wile being logged onto the server - but I want to do it exactly the other way around: I have my code on the LOCAL maschine and want to push it to the server regularly and also initially.

How would I do that? I cannot find an explanation.

Thanks Andreas

0 likes
3 replies
andreasb's avatar

Thank you but that does not solve my problem. I work on a windows machine and quite frankly I would like to avoid installing servers - I just want to push my local repo to an external server - is that so hard with normal git features? :)

Edit: I am now trying this here: http://toroid.org/git-website-howto

Please or to participate in this conversation.