This tutorial is designed to set up a complete Git workflow on Android, complete with LFS, and use it with the Godot editor.
The storage usage is minimal.
Be prepared to get a bit technical. You should be familiar with command line tools, and be comfortable with typing arcane sigils using whatever keyboard you have.
Find Termux here: https://termux.dev/en/
Download the latest release of Termux from either the GitHub Releases page or through F-Droid.
Personally, I went the GitHub route. You'll likely need to allow permission to install APKs through whatever browser you used to download it.
Once you've got it installed, open it. You'll be greeted with a pretty barebones terminal.
First, we need to install some packages:
~ $ pkg up # updates your existing packages
~ $ pkg install openssh # needed for SSH authentication
~ $ pkg install git
~ $ pkg install git-lfs # needed for LFS
You may need to progress through several confirmation prompts.
If you don't know what you're doing, all I did was hit y
on every prompt, and everything seemed to turn out fine.
We also need to tell Termux we want to access the shared storage, so run:
~ $ termux-setup-storage
That will create a directory in your home called storage
, which will contain several links to the shared directories on your phone:
~ $ ls storage
dcim downloads movies music pictures shared
Now is a good time to decide exactly where you want your Git repositories to be clones to.
If you were to clone a repo into your Termux home dir, it would work, but other Android apps wouldn't be able to access it.
This is why we set up the storage
directories, as they can be accessed by any apps.
In the storage
directory are several links, some of which go directly to specific locations, such as downloads
mapping directly to your Downloads folder.
The shared
link is special in that it points to the directory which is the root of your device's shared storage,
which is typically where the other shared folders are contained.
Personally, I made a directory called shared/Repos
, as I didn't want to clutter any of my other folders.
~ $ mkdir storage/shared/Repos
Wherever you decide, remember it for later.
I highly recommend using an SSH key, as it will make authenticating with GitHub a lot easier.
If you wish to use password-based authentication, you're on your own.
If you're not quite familiar with using SSH for GitHub, take a look at this: https://docs.github.com/en/authentication/connecting-to-github-with-ssh
First, we need to generate the key:
~ $ ssh-keygen -t ed25519
Personally I didn't bother setting a passphrase.
Next, I used cat
to quickly display the public key:
~ $ cat .ssh/id_ed25519.pub
And then manually copy-pasted it over to my browser, when setting up my SSH key in GitHub itself.
If you're not sure how to do that, refer to the docs linked above, or just go here: https://github.com/settings/keys
To test the SSH connection, you can run:
~ $ ssh -T [email protected]
Hi apples! You've successfully authenticated, but GitHub does not provide shell access.
The git setup is very typical.
First, configure your name and GitHub email:
~ $ git config --global user.name Apples
~ $ git config --global user.email [email protected]
Then, assuming you're planning on using Git LFS, you need to "install" it:
~ $ git lfs install
Updated Git hooks.
Git LFS initialized.
So, there's a slight problem:
If you were to attempt to clone a git repo anywhere inside of your shared
directory,
then the LFS hooks will fail to be executed.
Why? I don't know. Probably some security measure baked into Android.
Very fortunately, Git provides a way to relocate our .git
folder (and thus the hooks) while keeping the files in our intended location.
I made a directory in my Termux home simply called gitdirs
for this purpose.
~ $ mkdir gitdirs
Finally, with all of that out of the way, we can actually start cloning repositories!
In order to use the custom git dir location, you'll need to use the --separate-git-dir
option when cloning.
For example:
~ $ git clone --separate-git-dir=$HOME/gitdirs/ludum-dare-54 [email protected]:apples/ludum-dare-54.git
Install the Godot editor from the play store or other means.
When importing a project, simply select your project.godot
file as expected.
Use Termux to run further git commands such as status/commit/etc.
- If you're using Gboard, try switching it to floating window mode for a slightly better experience.
- Also might be worth giving another keyboard app a shot, Hacker's Keyboard seems popular.
- Unfortunately, it doesn't seem possible to export your game as an APK, you'll probably still need a desktop to do this.
- Maximize your code editor for a better experience (the button is in the upper-right of the code editor).
- Try adjusting your Display Scaling in the Editor Settings.