Skip to main content

atomic add

Add files to be tracked.

Synopsis

atomic add [OPTIONS] [FILES]...

Description

The add command tells Atomic to start tracking files in the repository. Once added, files become part of the working copy and their changes will be included in future atomic record operations.

Unlike some version control systems, Atomic doesn't have a staging area. Files are either tracked or untracked:

  • Tracked files: Monitored for changes, included in record operations
  • Untracked files: Ignored by Atomic unless explicitly added

Arguments

[FILES]...

Files or directories to add to tracking. Paths are relative to the current directory or can be absolute.

# Add a single file
atomic add README.md

# Add multiple files
atomic add src/main.rs src/lib.rs

# Add a directory
atomic add src/

# Add everything in the current directory
atomic add .

Options

-A, --all

Add all untracked files in the repository.

atomic add --all

-n, --dry-run

Dry run - show what would be added without doing it.

atomic add --dry-run src/

-f, --force

Force add ignored files.

# Add a file that matches an ignore pattern
atomic add --force build/important-artifact.bin

-r, --recursive

Recursively add directory contents.

atomic add --recursive src/

--no-recursive

Don't recursively add directory contents.

atomic add --no-recursive src/

-d, --directory

Track empty directories explicitly.

atomic add --directory assets/

Global Options

These options are available on all commands:

  • -v, --verbose - Emit extra diagnostic output
  • --no-color - Disable ANSI color in output
  • -h, --help - Print help
  • -V, --version - Print version

Examples

Adding Individual Files

# Add a single file
atomic add README.md

# Add specific source files
atomic add src/main.rs src/lib.rs Cargo.toml

Adding Directories

# Add all files in the src/ directory
atomic add src/

# Add directory contents recursively
atomic add --recursive src/

Adding All Untracked Files

# Add every untracked file in the repository
atomic add --all

Force Adding Ignored Files

# Add a file that matches an ignore pattern
atomic add --force .env.production

Previewing an Add

# See what would be added without making changes
atomic add --dry-run .

See Also