d0b06c17c0
add, addurl, importfeed, import: Added --no-check-gitignore option for finer grained control than using --force. (--force is used for too many different things, and at least one of these also uses it for something else. I would like to reduce --force's footprint until it only forces drops or a few other data losses. For now, --force still disables checking ignores too.) addunused: Don't check .gitignores when adding files. This is a behavior change, but I justify it by analogy with git add of a gitignored file adding it, asking to add all unused files back should add them all back, not skip some. The old behavior was surprising. In Command.Lock and Command.ReKey, CheckGitIgnore False does not change behavior, it only makes explicit what is done. Since these commands are run on annexed files, the file is already checked into git, so git add won't check ignores.
128 lines
3.1 KiB
Markdown
128 lines
3.1 KiB
Markdown
# NAME
|
|
|
|
git-annex add - adds files to the git annex
|
|
|
|
# SYNOPSIS
|
|
|
|
git annex add `[path ...]`
|
|
|
|
# DESCRIPTION
|
|
|
|
Adds the specified files to the annex. If a directory is specified,
|
|
acts on all files inside the directory and its subdirectories.
|
|
If no path is specified, adds files from the current directory and below.
|
|
|
|
Files that are already checked into git and are unmodified, or that
|
|
git has been configured to ignore will be silently skipped.
|
|
|
|
If annex.largefiles is configured, and does not match a file,
|
|
`git annex add` will behave the same as `git add` and add the
|
|
non-large file directly to the git repository, instead of to the annex.
|
|
(By default dotfiles are assumed to not be large, and are added directly
|
|
to git, but annex.dotfiles can be configured to annex those too.)
|
|
|
|
Large files are added to the annex in locked form, which prevents further
|
|
modification of their content unless unlocked by [[git-annex-unlock]](1).
|
|
(This is not the case however when a repository is in a filesystem not
|
|
supporting symlinks.)
|
|
|
|
This command can also be used to add symbolic links, both symlinks to
|
|
annexed content, and other symlinks.
|
|
|
|
# EXAMPLES
|
|
|
|
# git annex add foo bar
|
|
add foo ok
|
|
add bar ok
|
|
# git commit -m added
|
|
|
|
# OPTIONS
|
|
|
|
* `--no-check-gitignore`
|
|
|
|
Add gitignored files.
|
|
|
|
* `--force-large`
|
|
|
|
Treat all files as large files, ignoring annex.largefiles and annex.dotfiles
|
|
configuration, and add to the annex.
|
|
|
|
* `--force-small`
|
|
|
|
Treat all files as small files, ignoring annex.largefiles and annex.dotfiles
|
|
configuration, and add to git, also ignoring annex.addsmallfiles
|
|
configuration.
|
|
|
|
* `--backend`
|
|
|
|
Specifies which key-value backend to use.
|
|
|
|
* file matching options
|
|
|
|
Many of the [[git-annex-matching-options]](1)
|
|
can be used to specify files to add.
|
|
|
|
For example: `--largerthan=1GB`
|
|
|
|
* `--jobs=N` `-JN`
|
|
|
|
Adds multiple files in parallel. This may be faster.
|
|
For example: `-J4`
|
|
|
|
Setting this to "cpus" will run one job per CPU core.
|
|
|
|
* `--update` `-u`
|
|
|
|
Like `git add --update`, this does not add new files, but any updates
|
|
to tracked files will be added to the index.
|
|
|
|
* `--json`
|
|
|
|
Enable JSON output. This is intended to be parsed by programs that use
|
|
git-annex. Each line of output is a JSON object.
|
|
|
|
* `--json-progress`
|
|
|
|
Include progress objects in JSON output.
|
|
|
|
* `--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 to add is read in a line from stdin,
|
|
the file is added, and repeat.
|
|
|
|
Note that if a file is skipped (due to not existing, being gitignored,
|
|
already being in git, or doesn't meet the matching options),
|
|
an empty line will be output instead of the normal output produced
|
|
when adding a file.
|
|
|
|
* `-z`
|
|
|
|
Makes the `--batch` input be delimited by nulls instead of the usual
|
|
newlines.
|
|
|
|
# SEE ALSO
|
|
|
|
[[git-annex]](1)
|
|
|
|
[[git-annex-unlock]](1)
|
|
|
|
[[git-annex-lock]](1)
|
|
|
|
[[git-annex-undo]](1)
|
|
|
|
[[git-annex-import]](1)
|
|
|
|
[[git-annex-unannex]](1)
|
|
|
|
[[git-annex-reinject]](1)
|
|
|
|
# AUTHOR
|
|
|
|
Joey Hess <id@joeyh.name>
|
|
|
|
Warning: Automatically converted into a man page by mdwn2man. Edit with care.
|