1git-annex-import(1) General Commands Manual git-annex-import(1)
2
3
4
6 git-annex-import - move and add files from outside git working copy
7
9 git annex import [path ...]
10
12 Moves files from somewhere outside the git working copy, and adds them
13 to the annex. Individual files to import can be specified. If a direc‐
14 tory is specified, the entire directory is imported.
15
16 git annex import /media/camera/DCIM/*
17
18 When importing files, there's a possibility of importing a duplicate of
19 a file that is already known to git-annex -- its content is either
20 present in the local repository already, or git-annex knows of another
21 repository that contains it, or it was present in the annex before but
22 has been removed now.
23
24 By default, importing a duplicate of a known file will result in a new
25 filename being added to the repository, so the duplicate file is
26 present in the repository twice. (With all checksumming backends,
27 including the default SHA256E, only one copy of the data will be
28 stored.)
29
30 Several options can be used to adjust handling of duplicate files.
31
33 --duplicate
34
35 Do not delete files from the import location.
36
37 Running with this option repeatedly can import the same files
38 into different git repositories, or branches, or different loca‐
39 tions in a git repository.
40
41 --deduplicate
42 Only import files that are not duplicates; duplicate files will
43 be deleted from the import location.
44
45 --skip-duplicates
46 Only import files that are not duplicates. Avoids deleting any
47 files from the import location.
48
49 --clean-duplicates
50 Does not import any files, but any files found in the import
51 location that are duplicates are deleted.
52
53 --reinject-duplicates
54 Imports files that are not duplicates. Files that are duplicates
55 have their content reinjected into the annex (similar to git-
56 annex-reinject(1)).
57
58 --force
59 Allow existing files to be overwritten by newly imported files.
60
61 Also, causes .gitignore to not take effect when adding files.
62
63 file matching options
64 Many of the git-annex-matching-options(1) can be used to specify
65 files to import.
66
67 git annex import /dir --include='*.png'
68
69 --jobs=N -JN
70 Imports multiple files in parallel. This may be faster. For
71 example: -J4
72
73 --json Enable JSON output. This is intended to be parsed by programs
74 that use git-annex. Each line of output is a JSON object.
75
76 --json-error-messages
77 Messages that would normally be output to standard error are
78 included in the json instead.
79
81 Note that using --deduplicate or --clean-duplicates with the WORM back‐
82 end does not look at file content, but filename and mtime.
83
84 If annex.largefiles is configured, and does not match a file, git annex
85 import will add the non-large file directly to the git repository,
86 instead of to the annex.
87
89 git-annex(1)
90
91 git-annex-add(1)
92
93 git-annex-export(1)
94
96 Joey Hess <id@joeyh.name>
97
98 git-annex-import(1)