atomic init
Initialize a new Atomic repository in the current or specified directory.
Synopsis​
atomic init [OPTIONS] [PATH]
Description​
The init command creates a new Atomic repository by setting up the necessary directory structure and database files. This includes:
- Creating a
.atomicdirectory with the pristine database - Initializing a default view (usually named "main")
- Creating an
.ignorefile based on the project kind (if specified) - Setting up the repository configuration
Unlike some version control systems, atomic init creates a fully functional distributed repository with no dependency on a central server.
Options​
--view <NAME>​
Set the name of the initial view. If not specified, defaults to "main".
atomic init --view develop
-k, --kind <KIND>​
Specify the project kind to automatically configure the .ignore file with appropriate patterns. Atomic supports various project types:
rust- Rust projects (ignorestarget/,Cargo.lockfor libraries, etc.)node- Node.js projects (ignoresnode_modules/, etc.)python- Python projects (ignores__pycache__/,*.pyc, etc.)
atomic init --kind rust
[PATH]​
The directory path where the repository should be initialized. If not specified, initializes in the current directory.
atomic init /path/to/project
atomic init .
atomic init myproject
Examples​
Initialize in Current Directory​
atomic init
Creates a new repository in the current directory with default settings (view named "main").
Initialize with Custom View Name​
atomic init --view develop
Creates a repository with the initial view named "develop" instead of "main".
Initialize a Rust Project​
atomic init --kind rust myproject
Creates a new repository in the myproject directory with Rust-specific ignore patterns.
Initialize with All Options​
atomic init --view main --kind rust ~/projects/new-app
Creates a Rust project repository at ~/projects/new-app with the "main" view.
Repository Structure​
After running atomic init, your directory will contain:
.atomic/
├── pristine/ # redb database for repository state
├── config.toml # Repository-specific configuration
└── changes/ # Directory for change files (created on first record)
.ignore # Ignore patterns (if --kind was specified)
Notes​
- Idempotency: Running
initin a directory that already contains a.atomicfolder will result in an error. - Working Copy: The working copy (your actual files) remains unchanged by
init. Useatomic addto start tracking files. - Distributed: Every Atomic repository is complete and independent. There's no concept of a "central" repository.
- View: The initial view represents your main line of development. You can create additional views later with
atomic view create.
Configuration​
After initialization, you can configure the repository by editing .atomic/config.toml:
[author]
username = "username"
display_name = "Your Name"
[remote "origin"]
ssh = "ssh://user@host/path/to/repo"
Or use the global configuration at ~/.config/atomic/config.toml.
See Also​
atomic clone- Clone an existing repositoryatomic add- Start tracking filesatomic record- Record your first changeatomic view- Manage views
Related Concepts​
- Views - Independent lines of development (similar to branches)
- Pristine - The database that stores repository state
- Working Copy - Your actual files on disk