summaryrefslogtreecommitdiff
path: root/doc/git-annex-metadata.mdwn
blob: 7d613456b8fe18f22e5795cda2f807577ac5243c (plain)
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
78
79
80
81
82
83
# NAME

git-annex metadata - sets or gets metadata of a file

# SYNOPSIS

git annex metadata `[path ...]`

# DESCRIPTION

The content of an annexed file can have any number of metadata fields
attached to it to describe it. Each metadata field can in turn
have any number of values.

This command can be used to set metadata, or show the currently set
metadata.

When run without any -s or -t parameters, displays the current metadata.

# OPTIONS

* `-g field`

  Get the value(s) of a single field.

  The values will be output one per line, with no other output, so
  this is suitable for use in a script.

* `-s field=value`

  Set a field's value, removing any old values.

* `-s field+=value`

  Add an additional value, preserving any old values.

* `-s field-=value`

  Remove a value.

* `-s field?=value`

  Set a value, but only if the field does not already have a value set.
  
* `-t tag`

  Set a tag. Note that a tag is just a value of the "tag" field.

* `-u tag`

  Unset a tag.

* `--force`

  By default, `git annex metadata` refuses to recursively set metadata
  throughout the files in a directory. This option enables such recursive
  setting.

* file matching options
 
  The [[git-annex-matching-options]](1)
  can be used to specify files to act on.

* `--json`

  Enable JSON output. This is intended to be parsed by programs that use
  git-annex. Each line of output is a JSON object.

# EXAMPLES

To set some tags on a file and also its author:

	git annex metadata annexscreencast.ogv -t video -t screencast -s author+=Alice

# SEE ALSO

[[git-annex]](1)

# AUTHOR

Joey Hess <id@joeyh.name>

Warning: Automatically converted into a man page by mdwn2man. Edit with care.