Linux command
fossil-add 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Add a file
fossil add [file]
Add every new file
fossil add .
Show what would be added
fossil add --dry-run .
Include dotfiles
fossil add --dotfiles [path]
Add files matching a pattern, ignoring others
fossil add --ignore "[*.log,build/*]" [path]
Undo pending adds
fossil add --reset
Add a file
fossil add --allow-reserved [file]
说明
fossil add schedules one or more files (or directories, recursively) to be added to the repository on the next `fossil commit`. It does not write to the repository directly: staged additions live in the check-out metadata until committed. Dotfiles and files matching the configured `ignore-glob` are skipped unless overridden. Directory arguments are walked recursively. Use `fossil addremove` to stage both new and missing files in one call, or `fossil add --reset` to undo pending additions.
参数
- --case-sensitive _BOOL_
- Override the `case-sensitive` setting when matching file names.
- --dotfiles
- Include files whose name begins with a dot (hidden files). Without this flag, fossil ignores them.
- -f, --force
- Add files without prompting (useful when the file is outside the usual scope).
- --ignore _CSG_
- Comma-separated glob patterns of unmanaged files to skip. Overrides the `ignore-glob` setting.
- --clean _CSG_
- Comma-separated glob patterns of files to ignore for the `clean` operation. Overrides the `clean-glob` setting.
- --reset
- Remove the ADDED status from files previously staged with `fossil add` (they remain on disk, just not tracked for the next commit).
- --allow-reserved
- Permit filenames that are reserved on Windows (`CON`, `NUL`, `COM1`, …). Needed mainly on cross-platform repos.
- -v, --verbose
- Report each file affected by `--reset`.
- -n, --dry-run
- Show what would happen without touching the repository.
FAQ
What is the fossil-add command used for?
fossil add schedules one or more files (or directories, recursively) to be added to the repository on the next `fossil commit`. It does not write to the repository directly: staged additions live in the check-out metadata until committed. Dotfiles and files matching the configured `ignore-glob` are skipped unless overridden. Directory arguments are walked recursively. Use `fossil addremove` to stage both new and missing files in one call, or `fossil add --reset` to undo pending additions.
How do I run a basic fossil-add example?
Run `fossil add [file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --case-sensitive _BOOL_ do in fossil-add?
Override the `case-sensitive` setting when matching file names.