If you are struggling to commit your project on Github and you don’t know how to start then this post is for you. One thing that Fredrik Fornwall, the owner of termux has done is to fill the vaccum between pc users and android users , experience android users and programmers use android to code even online code.
Commiting a project to github on pc is quite easy and hard if you don’t know it , but the same stress is passed to a newbie therefore in this post we are going to use android smartphone to actualized our goal.
Why Android Phone? Some friends be like I don’t have a PC therefore i can’t code or people in rural Africa might say that since there is no constant electeicity there can’t code and they gave up; Termux has done it all for us, you can code and commit to github all on your android phone. Now before we start there are some apps that you need to install on your phone.
Table of Contents
Why GitHub?
Device for This Post.
What is Termux
Easy way to upload your files on Github
Applications to be installed
Steps to COMMIT a Project on github using android with pictures
GitHub is a web-based interface that uses Git, the open source version control software that lets multiple people make separate changes to web pages at the same time. As Carpenter notes, because it allows for real-time collaboration, GitHub encourages teams to work together to build and edit their site content.
Termux is a free and open source terminal emulator for Android which allows for running a Linux environment on an Android device. In addition, various software can be installed through the application’s package manager. Termux. nano running on termux.
Device for This Post.
For this tutorial we will be using android version of 5 or higher ones, So make your phone ready with at least 3gig free space and internet connection
First easy way to install git and push your app to Github
Install Git & SSH:
If you followed the method as described then you don’t need this steps .We need to update and upgrade using the below command before we install Git and SSH.
apt update && apt upgrade
After that, we can install Git and SSH now
apt install git openssh
Setting the Git Storage:
Set the storage for termux using the command: termux-setup-storage. It will ask you to access the storage of your mobile phone. Allow this to continue.
Connect to GitHub:
We need to create the key-pair of SSH using the command:
ssh-keygen -t rsa -C "YOUR_EMAIL_ADDRESS"
Here, YOUR_EMAIL_ADDRESS is your email id associated with your GitHub account.
Log in to GitHub:
Log into your GitHub account using the command:
ssh -T git@github.com
After successful authentication, you can start using Git on your Android device. You can create, pull, push the repositories. This is the easy way to use Git on your smartphone.
If the above steps doesn’t work for you , don’t worry follow the next guide it works for every phone.
Illustration of how you can also use another method below to upload your files on GitHub
Application needed for this tutorial are listed below
- Hackersor Codeboard keyboard. Installation of hackers keyboard is not mandatory you can install hackers keyboard as well.
- Termux-Install termux
For some codes to work for you must install termux as described above or after installing termux on you also install termux API
Now you have installed the applications mentioned above then go to your favorite browser then opengithub.com then create account.After account creation head over to your profile then you will see repository then add new repo
Now you have created account create a repository and select the visibility as private.The image below is the commands for uploading projects on your github.
After you have created a github repo you would be redirected to a page showing you code to run deploy and existing app or create a new project like the one above. but we have to install python so that we can also install git.
echo "# mytuto" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/yourusername/repositoryname.git
git push -u origin main
Go to your github create an auth token which you can use to deploy app to your github.You have to create a token with this, only you can deploy app to your repo or people you allowed to do so. Go to settings choose developer settings then go to token and authentication then create a personal token that will expire within a month.
Now you need a developer settings you need to create a token for your webapp.
Click on the personal access tokens then create an auth token select all that applies, then create and save it somewhere for your use
Before we can push i assumed that you have install termux and your project is ready. We have to install git by doing this lets install python first run this code on your termux terminal
dpkg install python3 #or
apt install python
#Now after installing python you have to update
apt update && upgrade -y
#now install git
apt install git
After installing python and git is successful, now is time to commit our project to GitHub
Steps to COMMIT a Project on github using androidwith pictures
First step
Run this command
git init
Your project have been initialized with git installed
Secondly run this command
git add .
git commit -m "first commit"
#This command will create all your project and ready to push
Thirdly run this Command
git branch -M main
git remote add origin https://github.com/yourusername/repositoryname.git
#add your own username and repository name
Fourtly the personal token you have created copy it then run this command
git push -u origin main
#When asked <strong>for</strong> username enter your username
#when asked <strong>for</strong> password enter your personal access token you have created then hit enter
After running it go to your github present repo then refresh you will see the projects you have committed
Now you have successfully committed your project to GitHub, You can deploy it to any host server to host it fred for you .
Leave us a comment below and we will continue to update this post if there is any changes