Git: How to create a repository on a web server

David Nash bash, linux 0 Comments

I’m writing this mainly for my own reference. I found it very difficult to find instructions on using git for what I wanted. The scenario: I have a web server (example.com), which I can ssh into. It has a website running on /var/www/website/. I want to create a git repo for it, and then from my development machine (devmachine) clone that repo, make changes, and when I’m happy push them to the web server. I already have ssh keys installed so I can ssh from devmachine to example.com. On both example.com and devmachine I have a user david who is …