- Termux
- Material Files (for easy access to copy file paths)
-
Grant Storage Access to Termux
Before anything else, run the following command in Termux to allow it to access your device’s storage:
termux-setup-storageConfirm the storage permission prompt.
-
Install Git and GitHub CLI
pkg install git gh
-
Log in to GitHub
gh auth loginFollow the on-screen prompts. If you have 2FA enabled, enter your verification code when asked.
-
Navigate to Your Folder
Use the
cdcommand to move into the folder you want to upload:cd /path/to/folder(Tip: Use Material Files to get the exact folder path.)
-
Initialize a Git Repository
git init
-
Add Files to the Repository
git add .
-
Commit the Changes
git commit -m "Initial commit"(You can replace
"Initial commit"with any custom message.)
-
Create or Use a GitHub Repository
Go to GitHub and create a new repository, or use an existing one.
-
Set the Remote Repository
Copy the HTTPS or SSH URL of your GitHub repo, then run:
git remote add origin <YOUR-REPO-URL>Replace
<YOUR-REPO-URL>with your actual repo URL.
- Push Your Files to GitHub
git push -u origin main
If you get this error:
error: src refspec main does not match any
Run this command first:
git checkout -b main
Then push again.
Your folder and its contents should now be uploaded to your GitHub repository. Check GitHub via your browser to confirm.
If this tutorial helped you, check out the video tutorial for a step-by-step walkthrough. And consider subscribing to my YouTube channel — I post helpful tech content regularly. Thanks for your support!
If you find my work helpful, you can support me by donating: