Im not sure if this is the “proper” way to do it. Well, it sort of works for me at the moment so I thought I’ll share it here. I did use FTP at first (using FileZilla) but I didnt really like the workflow.
- Host: BlueHost shared account
- Client: Windows 10
- SSH/Shell Access should be enabled. I enabled this from my cPanel -> SSH/Shell Access menu.
- SSH to BlueHost host. By default, my website was installed inside
~/public_htmlfolder. I created a new folder named
~/www-checkout. This will be my new “live” website.
- I copied everything from
- I renamed my
~/public_html_original. Just for backup.
- Then I created a symbolic link named
~/public_htmlthat points to
- Then I created my main git repository folder named
- Then I added a
post-receivescript inside hooks folder that will do a checkout to
~/www-checkoutevery time the repository is updated.
Contents of post-receive (edited using vim)
- Then I created a new “work” folder named
~/www-workfor my initial commit, cloned the still empty git repository, then copied the contents of
- Before the commit, I deleted the files that I thought should not be included in the source.
- (Optional) Edit source files.
- Commit source files.
Thats it. Now to the client side.
- I installed Git for Windows from here.
- The I created a working folder, right-click -> Git Bash Here menu (I checked the context menu during installation, which by default, was already checked anyway).
- Clone the repository.
I now have a working source copy in my Windows client machine!
One thing I can think of is that every edit goes directly to live folder. So I dont have a sort of “staging” server for me to test before putting changes to live. Both a blessing and a curse, I think. But then again, this is just a simple blog, using a free theme, so I dont think I will be doing any massive changes to the source code anyway.---
If you have any questions or feedback, please reach out @flowerinthenyt.