Repository Management
Commands for creating, cloning, and managing Atomic repositories.
Commands​
| Command | Description |
|---|---|
init | Initialize a new Atomic repository |
clone | Clone an existing repository from a remote |
reset | Reset working copy to the last recorded state |
split | Create a new stack from an existing one |
Creating a Repository​
From scratch​
# Initialize in the current directory
atomic init
# Initialize with a custom stack name
atomic init --stack main
# Initialize with project-specific ignore patterns
atomic init --kind rust
This creates the .atomic/ directory structure:
.atomic/
├── pristine/ # Graph database (redb)
├── changes/ # Content-addressed change files
├── config.toml # Repository configuration
├── current_stack # Active stack name
└── working_copy_id # Working copy state
From a remote​
# Clone a repository
atomic clone https://api.atomic.dev/acme/platform/core/code
# Clone into a specific directory
atomic clone https://api.atomic.dev/acme/platform/core/code myproject
Resetting the Working Copy​
The reset command discards uncommitted changes and restores the working copy to the last recorded state:
# Discard all uncommitted changes
atomic reset --force
# Reset specific files
atomic reset src/main.rs
# Preview what would be reset
atomic reset --dry-run
Splitting Stacks​
The split command creates a new stack by forking from an existing one. All changes from the source stack are inherited by the new stack:
# Split from current stack
atomic split experimental
# Split and switch to the new stack
atomic split feature-auth --switch
This is equivalent to atomic stack new <NAME> --from <SOURCE>.
See Also​
- Working with Changes — Recording and reviewing changes
- Stack — Managing stacks
- Remote Operations — Push, pull, and clone