Termux is an Android app that can run some Linux software in a terminal.
git-annex is not currently part of the Termux distribution, but it's easy to install it. Paste these commands into Termux:
pkg install git wget tar coreutils proot
termux-setup-storage
cd
wget https://downloads.kitenet.net/git-annex/autobuild/armel/git-annex-standalone-armel.tar.gz
tar zxf git-annex-standalone-armel.tar.gz
rm git-annex-standalone-armel.tar.gz
git-annex.linux/runshell
Now you can set up a git-annex repository or two, to manage your Android files. To avoid typing any more, you can start up the git-annex webapp and set things up in there:
git annex webapp
Or you can continue using git-annex at the command line. Here we'll make a repository for photos:
cd ~/storage/dcim
git init
git annex init
You can go on to set up a ssh remote pointing to a server, and sync your files to and from it.
And so on. Most ways you would use git-annex on a Linux system work fairly well in this Termux environment.
Starting on boot
If you install the Termux:Boot app, git-annex will also integrate with it. Repositories you create with the webapp (or list in ~/.config/git-annex/autostart) will have the assistant started in them on boot, so you don't need to start it manually.
Known limitations
Direct mode
git-annex will probably default to direct mode due to the limitations of Android's /sdcard. You can get around this using v6 unlocked repositories, or by putting the git-annex repository on a better filesystem on the Android device, such as your termux home directory.
This line causes termux to say "Bad System Call"
git-annex.linux/runshell
It also first complained about /bin/sh being missing, but stopped after restarting termux.
@hobbes we're working on that issue, which seems likely to involve arm64, here: https://github.com/termux/termux-packages/issues/420
Found this issue thread:
https://github.com/termux/termux-packages/issues/420
which had the solution to this particular issue! Yay \o/! Needed to call
I'm noticing that the arm builds are missing now (current 403s, autobuild 404s), but maybe that's intentional for now? Either way, I have gotten past the bad system call issue with
runshell
, but now when I try to rungit annex webapp
I get...I ran
pkg install perl
, but I get the same message :(. Either way, I'm glad this seems to be moving forward, and very excited that I might finally be able to put git-annex back on my phone after all these years!@hobbes, that error means Android's system call filter has blocked a system call that's needed to run git-annex, unfortunately.
We now have a workaround that seems to work,
pkg install proot
and use proot to run git-annex. Tomorrrow's daily build of the git-annex standalone bundle will do that automatically.