Skip to main content
Documentation

Repositories

A Dits repository is a directory that tracks the history of your files, storing all versions efficiently using content-addressed chunks.

Creating a Repository

Initialize a new repository with dits init:

$ mkdir my-project
$ cd my-project
$ dits init

Initialized empty Dits repository in /home/user/my-project/.dits
Created default branch: main

Or clone an existing repository:

$ dits clone https://example.com/team/project

Cloning into 'project'...
Fetching metadata... done
Repository cloned (12 commits, 45 GB)

Repository Structure

A Dits repository consists of two main parts: the working directory (your files) and the .dits directory (version control data).

.ditsDits repository data
configRepository configuration
HEADCurrent branch reference
indexStaging area
objectsContent-addressed storage
chunksFile chunks
assetsFile manifests
treesDirectory manifests
commitsCommit objects
refsBranch and tag references
headsLocal branches
remotesRemote tracking branches
tagsTags
hooksRepository hooks
footageYour working files
scene1.mov
scene2.mov
project.prproj

Key Components

Working Directory
The actual files you work with. These are regular files on your filesystem that you can edit with any application.
Object Store
The .dits/objects directory contains all versioned data as content-addressed objects (chunks, assets, commits).
References
Named pointers to commits. Branches and tags are stored in.dits/refs and point to commit hashes.

The Staging Area (Index)

Like Git, Dits has a staging area that sits between your working directory and the repository. When you run dits add, files are staged (chunked and hashed) but not yet committed.

Working Directory → Staging Area → Repository
                    (dits add)     (dits commit)

$ dits add footage/scene1.mov
Chunking footage/scene1.mov... 10,234 chunks

$ dits status
Changes to be committed:
  new file: footage/scene1.mov

$ dits commit -m "Add scene 1 footage"
[main a1b2c3d] Add scene 1 footage
 1 file changed, 10 GB added

Repository Configuration

Each repository has its own configuration in .dits/config:

# .dits/config
[core]
    repositoryformatversion = 0

[remote "origin"]
    url = https://example.com/team/project
    fetch = +refs/heads/*:refs/remotes/origin/*

[branch "main"]
    remote = origin
    merge = refs/heads/main

[user]
    name = Jane Editor
    email = jane@example.com

Bare Repositories

A bare repository has no working directory - only the .ditscontents. These are typically used for central/server repositories.

$ dits init --bare project.dits

Initialized empty bare Dits repository in /home/user/project.dits

$ ls project.dits/
config  HEAD  hooks/  objects/  refs/

Repository States

Your working directory can be in various states relative to the repository:

Clean

Working directory matches the latest commit.

$ dits status
On branch main
nothing to commit, working tree clean

Modified

Files have been changed but not staged.

$ dits status
On branch main
Changes not staged for commit:
  modified: footage/scene1.mov

Staged

Files have been added to the staging area.

$ dits status
On branch main
Changes to be committed:
  modified: footage/scene1.mov

Untracked

New files that aren't yet tracked by Dits.

$ dits status
On branch main
Untracked files:
  footage/new_scene.mov

Ignoring Files

Create a .ditsignore file to exclude files from version control:

# .ditsignore

# Temporary files
*.tmp
*.bak

# OS files
.DS_Store
Thumbs.db

# Render outputs (regeneratable)
/renders/

# Cache directories
.cache/
*.cache

# NLE autosave files
*.autosave
*.prproj.tmp

Repository Size

Check the size of your repository with dits du:

$ dits du

Object Store:
  Chunks:    45,892 objects    (12.5 GB)
  Assets:     1,234 objects    (2.1 MB)
  Trees:         89 objects    (156 KB)
  Commits:       42 objects    (84 KB)

Total repository size: 12.5 GB
Working directory size: 45.2 GB
Deduplication ratio: 3.6x

Maintenance

Dits repositories occasionally need maintenance to optimize performance:

Garbage Collection

Remove unreferenced objects to free space:

$ dits gc

Finding unreachable objects...
Found 234 unreachable chunks (567 MB)
Removing unreachable objects... done
Freed 567 MB

Integrity Check

Verify all objects are intact:

$ dits fsck

Checking 45,892 chunks...
Checking 1,234 assets...
Checking 89 trees...
Checking 42 commits...

All objects verified. No corruption detected.

Next Steps