Edit your website on your android phone using termux and git!

In the last post, I showed you how to set up your server so you can deploy with git. Today, I'll show you how to write on your phone and directly deploy it to your server!

I am writing these posts on iA Writer, my favourite markdown editor, but any text editor should work.

You need to download termux and install git. Termux on google play is unsupported, so we will need to install the alternative store F-Droid first.

  1. install F-Droid
  2. Install termux from F-Droid
  3. Run termux-setup-storage
  4. Run mkdir ~/storage/shared/workspace
  5. Run ln -s ~/storage/shared/workspace ~/workspace.
  6. Now the folder workspace is reachable in the homefolder and this is where we'll put the git repo, but first we'll need to setup ssh
  7. pkg update
  8. pkg upgrade
  9. Run pkg install openssh
  10. mkdir ~/.ssh
  11. Nano ~./config (read the post before to know what to put in there)
  12. check connection by running ssh example.com
  13. Go to the workspace folder, and run git clone ssh://example.com/path/to/your/.git
  14. You can now open those files in iAWriter using the file selector. Make changes, commit using git commit -am "message" and git push.
  15. Your changes are online.

Success!

This website is written in PHP and markdown posts and using this way I can easily update it on my phone.