Following the process explained in adb, I tried exporting a subfolder to the sdcard of my phone.
git annex initremote android type=adb androiddirectory=/sdcard/Music encryption=none exporttree=yes
The annex repository I am exporting from contains several subfolders with music albums. Using
git annex export master:album --to=android
results in the contents of the album folder going to the root Music folder on the remote, instead of in the Music/album folder.
How do I create a tree that contains the subfolder itself too?
git-annex will filter the tree it exports to only the files that are configured to be preferred content of the remote. So you could do this:
See git-annex-preferred-content for details about the syntax, but basically you can extend that to as many directories as you want, separated by "or"; it will include any files in any of those directories.
Worth noting that is a general git question really, with several valid answers that don't involve git-annex at all. (One easy one is to check out a new branch,
git rmeverything except the subfolder, andgit commit.)And once you have such a tree stored on a git branch, you can pass that branch to
git-annex export. So that's an option if you don't want to need to deal with git-annex's own filtering features.