Example Image Upload from Phone Using Termux
After my previous attempt with the GitHub Android app didn’t work, I decided to try Termux - a powerful terminal emulator for Android that gives you full git functionality.
This post demonstrates the complete workflow from first-time setup to uploading images directly from my phone to this blog.
First-Time Setup
Installing and Setting Up Termux
- Install Termux from F-Droid (recommended) or Google Play Store
- Open Termux and run the initial setup:
# Update packages
pkg update && pkg upgrade
# Install essential tools
pkg install git gh openssh termux-api
# Set up storage access (grant permission when prompted)
termux-setup-storage
Connecting to GitHub
- Authenticate with GitHub using the GitHub CLI:
# Login to GitHub
gh auth login
Follow the prompts to authenticate via web browser or token.
First Clone of the Repository
- Clone your blog repository:
# Clone the repository
git clone https://github.com/davegoopot/davegoopot.github.io.git
# Navigate to the repository
cd davegoopot.github.io
# Verify the clone worked
ls -la
- Configure git identity (if not already done):
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Uploading an Image
Now for the actual workflow demonstration. I drew a quick diagram on paper and photographed it with my phone.
Step 1: Copy the Image
# Navigate to the repository
cd davegoopot.github.io
# Use termux-storage-get to select and copy image from storage
# This opens a file picker interface
termux-storage-get images/2025-07-26-termux-workflow-diagram.jpg
The termux-storage-get
command opens a file picker where you can browse and select your image from anywhere on your device - camera folder, downloads, or any other location. It’s much more user-friendly than navigating file paths manually.
Step 2: Commit and Push
# Add the image
git add images/2025-07-26-termux-workflow-diagram.jpg
# Commit with descriptive message
git commit -m "Add Termux workflow diagram for mobile blogging post"
# Push to GitHub
git push
The Result
Caption: Hand-drawn diagram uploaded successfully using Termux.
How Did It Go?
- The upload from the phone was simple enough.
- The Copilot got the path of the image user wrong at the first attempt. It fixed it with a quick issue and pull request.
- But the image sizing was all wrong. I’m going to raise a ticket for the Copilot to fix that. Copilot fixed the image sizing with CSS. Looks good.