File: Android.mdwn

package info (click to toggle)
git-annex 10.20230126-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 69,344 kB
  • sloc: haskell: 74,654; javascript: 9,103; sh: 1,304; makefile: 203; perl: 136; ansic: 44
file content (77 lines) | stat: -rw-r--r-- 2,678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
git-annex is available for Android inside Termux or Nix-On-Droid.
This includes the [[git-annex assistant|/assistant]], for easy
syncing between your Android and other devices. You do not need
to root your Android to use git-annex.

(Alternatively, rather than installing git-annex on your Android device,
git-annex can run on your computer and use `adb` to pull and push changes
to the Android device. See [[tips/android_sync_with_adb]] for instructions
on using git-annex that way.)

[[!toc ]]

## Installation (Termux)

First, install [Termux](https://termux.com/). This is an Android app that can
run some Linux software in a terminal, including git-annex.

git-annex is not currently part of the Termux distribution, but it's easy
to install it. Paste these commands into Termux:

	pkg install wget
	wget https://git-annex.branchable.com/install/Android/git-annex-install
	source git-annex-install

## Installation (Nix-On-Droid)

Installing git-annex using
[Nix-On-Droid](https://github.com/t184256/nix-on-droid) is recommended
for more advanced users who want to use git-annex at the command line.
The git-annex webapp does not currently work in Nix-On-Droid.

To enter a shell with git-annex available to use,
run inside Nix-On-Droid: `nix-shell -p git git-annex`

To avoid needing to do that every time you start Nix-On-Droid,
you can add git and git-annex to your `environment.packages` in 
`~/.config/nixpkgs/nix-on-droid.nix` and then run 
`nix-on-droid switch`

## Starting git-annex assistant

Just run "git-annex webapp" inside Termux.
A browser window will open with the git-annex interface.

[[!img webapp.png alt="git-annex webapp"]]

## Closing and reopening the webapp

The webapp does not need to be left open after you've set up your
repository. As long as Termux (or Nix-On-Droid) is left open, git-annex 
will remain running and sync your files.

## Starting at power on

If you install the [Termux:Boot app](https://wiki.termux.com/wiki/Termux:Boot),
git-annex will be automatically started when your Android device
powers on. It will run in the background in whatever repositories you have
set up in the webapp.  

## Using the command line

If you prefer to use `git-annex` at the command line, you can do so inside
Termux or Nix-On-Droid. 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 the Termux environment.

## Upgrading (Termux)

To upgrade to a new git-annex release, just run `git-annex-install` again.