arc/docs/getting-started.md

70 lines
1.4 KiB
Markdown

# Getting Started
Arc is a delta-based version control system written in Rust. It builds exclusively through Nix.
## Building
Arc uses a Nix flake (nixpkgs-unstable, flake-parts, fenix, crane):
```sh
nix build
```
Enter a dev shell with `nix develop` (provides rustc, cargo, clippy, rustfmt, git, pkg-config, cmake, perl).
Run Arc with `nix run` or `result/bin/arc` after building.
## Configuration
```sh
arc config set user.name "yourname"
arc config set user.email "you@example.com"
```
Global config lives at `$XDG_CONFIG_HOME/arc/config.yml` (or `~/.config/arc/config.yml`).
## Creating a Repository
```sh
arc init [path]
```
This creates a `.arc/` directory containing:
- `commits/` — commit storage
- `bookmarks/` — branches (default: `main`)
- `tags/` — tagged commits
- `stashes/` — stashed changes
- `config.yml` — repository config
- `HEAD` — current position
The default remote is `origin`.
## Tracking Changes
Arc tracks changes automatically — there is no staging area.
```sh
arc status # see what changed
arc commit <message> # commit all changes
arc log # view history
arc diff # see diffs
```
## Ignoring Files
Create a `.arcignore` or `.ignore` file with gitignore-like glob syntax. Prefix a pattern with `!` to negate it.
## Working with Git Repositories
Clone a git repo:
```sh
arc clone <url> [path]
```
Migrate an existing git repo (run inside the repo):
```sh
arc migrate
```