GitOnSharedHost
Created Friday 02 December 2022
Recently I set up read-only Git repository hosting on Dreamhost for my project JACL. This was kind of tricky, so here are the steps:
- In the Dreamhost control panel, set up SSH for a user.
- Once you can log in with a password, you probably want to set up key-based authentication.
- On the remote host,
cdinto the directory corresponding to your hosted domain. mkdir your-repo.gitcd your-repo.gitgit init --barecp hooks/post-update.sample hooks/post-update- Back in your local repo, run a command like the following:
git remote add origin ssh://user@northbend.dreamhost.com:/home/user/example.com/your-repo.gitsubstitutinguser,northbend.dreamhost.com, andexample.comwith your particulars. git push -u origin master- Now, you should be able to
git pushand anyone on the Internet should be able togit clone https://example.com/your-repo.git