NAME
git-annex find - lists available files
SYNOPSIS
git annex find [path ...]
DESCRIPTION
Outputs a list of annexed files in the specified path. With no path, finds files in the current directory and its subdirectories.
OPTIONS
matching options
The git-annex-matching-options(1) can be used to specify files to list.
By default, the find command only lists annexed files whose content is currently present. Specifying any of the matching options will override this default behavior.
To list all annexed files, present or not, specify
--include "*"
.To list annexed files whose content is not present, specify
--not --in=here
--branch=ref
List files in the specified branch or treeish.
--print0
Output filenames terminated with nulls, for use with
xargs -0
--format=value
Use custom output formatting.
The value is a format string, in which '${var}' is expanded to the value of a variable. To right-justify a variable with whitespace, use '${var;width}' ; to left-justify a variable, use '${var;-width}'; to escape unusual characters in a variable, use '${escaped_var}'
These variables are available for use in formats: file, key, backend, bytesize, humansize, keyname, hashdirlower, hashdirmixed, mtime (for the mtime field of a WORM key).
Also, '\n' is a newline, '\000' is a NULL, etc.
The default output format is the same as
--format='${file}\\n'
--json
Output the list of files in JSON format.
This is intended to be parsed by programs that use git-annex. Each line of output is a JSON object.
--json-error-messages
Messages that would normally be output to standard error are included in the json instead.
--batch
Enables batch mode, in which a file is read in a line from stdin, its information displayed, and repeat.
Note that if the file is not an annexed file, or is not present, or otherwise doesn't meet the matching options, an empty line will be output instead.
-z
Makes the
--batch
input be delimited by nulls instead of the usual newlines.
SEE ALSO
git-annex(1)
AUTHOR
Joey Hess id@joeyh.name
Warning: Automatically converted into a man page by mdwn2man. Edit with care.
Sometimes I want to move files from one git annex repo to another. It would be really awesome if one could so something like:
Just to make myself clear. I do not mean "other remote" (foreign instance of "same" repo). I actually mean different repos without common location tracking, no common branches, etc. The only concession I would make (since I think it's necessary) would be that the same backend has to be used in both repos.
This approach could also be relevant for other git annex commands, e.g.:
Is there any way to do it? Or would this be a feature request worth to consider?
Actually, that's not even true:
lookupkey
doesn't seem to work on a bare repo. So I don't see how I can get the list of keys that are going to be moved or copied when agit annex move ...
orgit annex copy ...
is run from a bare repo.Thanks for the quick answer and for the tip.
findref
still displays file names, so OK, I can pipe the output withlookupkey
to have the corresponding list of keys. Still, my understanding is that the computation is not the same as a potentialfind --all
(orfind
on bare repos), in the sense that commands likemove --all
(ormove
on bare repos) only scan the files that are present in the repo, whereasgit annex findref master
looks at the whole branch regardless of where the files are. Sure, I can filter it withfindref master --in=here
, but the computational cost wouldn't be the same, would it? (imagining that my repo contains orders of magnitude fewer files than the branch) Also,move --all
catches past versions of files that are still in the repo, i.e. "unused files", whereas I guessfindref master --in=here
would miss them? It's just that commands likemove --all
start by doing the job I want before taking an action on the files, so I just wish there was a "no-action" version of them. A--dry-run
option inmove
andcopy
would be good enough. I tried to trick themove
command with amove --all ... --from=here --to=here
but of course I was outsmarted by the command :-)You can use
git annex findref master
in a bare repository, which is like find but operates on some branch.I am not convinced that find --all would really be that useful, since it would have to display keys and not filenames, and find is all about displaying filenames. I did make find error out in a bare repo rather than not doing anything.