| sidebar_position | 2 |
|---|---|
| title | init |
Initialize a new Atomic repository in the current or specified directory.
atomic init [OPTIONS] [PATH]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.
Set the name of the initial view. If not specified, defaults to "main".
atomic init --view developSpecify 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 rustThe 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 myprojectatomic initCreates a new repository in the current directory with default settings (view named "main").
atomic init --view developCreates a repository with the initial view named "develop" instead of "main".
atomic init --kind rust myprojectCreates a new repository in the myproject directory with Rust-specific ignore patterns.
atomic init --view main --kind rust ~/projects/new-appCreates a Rust project repository at ~/projects/new-app with the "main" view.
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)
- 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.
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.
atomic clone- Clone an existing repositoryatomic add- Start tracking filesatomic record- Record your first changeatomic view- Manage views
- Views - Independent lines of development (similar to branches)
- Pristine - The database that stores repository state
- Working Copy - Your actual files on disk