summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar https://mey.vn/ <https://mey.vn/@web>2015-08-06 22:46:11 +0000
committerGravatar admin <admin@branchable.com>2015-08-06 22:46:11 +0000
commit7ca4fefccb1b0c98867a0e422b449e340b1cc476 (patch)
tree4ece5e2ba5267850e00feccffcd6e8a56d19cbc1
parente2e5a038268c7e822a402fd785872cb309720739 (diff)
-rw-r--r--doc/forum/checkout_view_to_directory_outside_of_annex.mdwn23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/forum/checkout_view_to_directory_outside_of_annex.mdwn b/doc/forum/checkout_view_to_directory_outside_of_annex.mdwn
new file mode 100644
index 000000000..4369f86e8
--- /dev/null
+++ b/doc/forum/checkout_view_to_directory_outside_of_annex.mdwn
@@ -0,0 +1,23 @@
+i am working on a project where i need to copy many subsets of files stored in a single annex repo to separate folders outside of the annex repo.
+
+to select the subset, i'm using `git annex metadata --set <tag> <path>`.
+
+what i would like to do, ideally, is to leverage `git annex view` to directly check out the files to a specific directory outside of the annex repo.
+
+the use case is basically the "Copying objects" strategy of the [syncthing special remote discussion](http://git-annex.branchable.com/todo/syncthing_special_remote/), although rather than having the 'directory' special remote contain files in that remote's specific layout, i would like them to be checked out simply with their original file names.
+
+say i have these files in my main annex repo:
+
+ a.pdf (metadata: topic=haskell)
+ b.pdf (metadata: topic=haskell)
+ c.pdf (metadata: topic=iojs)
+ d.pdf (metadata: topic=python)
+ e.pdf (metadata: topic=haskell)
+
+if i issue `git annex view topic=haskell`, i have the files i want in my annex' root:
+
+ a.pdf
+ b.pdf
+ e.pdf
+
+obviously i could then simply run `rsync --exclude .git -aL --delete . ../other/dir`, which is totally fine, but maybe i'm just blindly missing something obvious and i could simply use something like `git annex --work-tree=../other/dir view topic=haskell` and see `a.pdf`, `b.pdf` and `e.pdf` appear in the target directory (i don't need any metadata in that directory, so only the plain files and no .git folder for a remote is fine).