Git Management on Android

How to install a git management system by terminal on Android

My goal here is to install a Git management system, by terminal, on an Android phone using the exact same workflow as in Linux. And then be able to sync files and folders securely from Github & Gitlab.

We’ll use Termux terminal, but don’t get it from the PlayStore! The only working and up-to-date version is on F-Droid, the open-source deGoogled app store.


  • Download and install the F-Droid APK package (you need to authorize Unknown sources)
  • Update F-Droid respositories
  • Search for Termux on the store, then install it
  • Run Termux
  • Install the following base packages from command line:
pkg install git openssh

Enable access to share storage within Termux by running:


Configure Git

Create Git global config on your phone:

git config — global 'John Doe'
git config — global ''

Setup SSH Keys

Before cloning your repo, setup your SSH key:

touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
cat ~/.ssh/ >> ~/.ssh/authorized_key
chmod 600 ~/.ssh/authorized_keys

Copy your SSH key into account preferences > SSH keys:

cat ~/.ssh/ 

then copy/paste into

Clone repo(s)

mkdir ~/storage/shared/Repos
cd ~/storage/shared/Repos
git clone


Like in any Linux distro, add aliases to .bashrc.

The file default storage is: /data/data/com.termux/files/home/ but you may want to create a new .bashrc file in your personal folder.

Iinstall vim package to edit text/config files, then create .bashrc:

pkg install vim
vim ~/.bashrc

Add your aliases, here are some I often use:

alias la="ls -a"
alias repo="cd ~/storage/shared/Repos"
alias push="git pull && git add . && git commit -m 'mobile push' && git push"

Refresh the source:

source ~/.bashrc

Now you have a fully functional terminal on your phone!

Have fun!



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store



OS explorer, UI & UX passionate, Voxels crafter, code lover, Video Games player, Podcasts listener, Music amateur // Digital Publishing professional