Darcs Quick Start

Setting up a repository

Creating a new repository on hub.darcs.net (optional)

If you want, you can create you own repository on http://hub.darcs.net, a repository hosting service.

Cloning an existing repository

If you have an existing repository, you can clone it (insert –lazy at the end of the command if you just want a latest working copy fast and retrieve all the patches later on)

$ darcs clone user_name@hub.darcs.net:user_name/repo_name
Copying patches, to get lazy repository hit ctrl-C...
Finished cloning. 

Start a new repository from scratch locally

$  darcs init      # initialise the repository
  Repository initialized.

Working with repositories

Adding new files

$ echo foo > my_file  # create a new file
$ darcs whatsnew -l   # show unrecorded files
a ./my_file
$ darcs whatsnew      # show unrecorded changes of files tracked by Darcs
No changes!
$ darcs add my_file   # track file
  Adding 'my_file'
$ darcs whatsnew
addfile ./my_file
hunk ./my_file 1

Recording changes

darcs record helps you creating a patch in you repository (in other systems this would be called a commit):

$ darcs record -m "patch name"
addfile ./my_file

# then follow on-screen instructions

Pushing the changes to a remote repository

If you already defined the repository (e.g, in case you clone the working directory from an existing repository)

$ darcs push 

If you did not do yet

$ darcs push repository_address

Other commands


darcs diff show unrecorded changes as a diff
darcs diff -p NAME show changes of last patch matching NAME as a diff


darcs revert revert unrecorded changes in the working copy
darcs unrecord un-record a patch in this repo, preserving working copy
darcs obliterate completely erase a patch from this repo and working copy
darcs rollback apply inverse of recorded patch to working copy

moving patches

darcs clone USER@HOST:PATH
darcs pull merge new changes from upstream, updating the working copy
darcs push add our new changes to the upstream repo


darcs log list patches
darcs send send patches by mail (see Send)
darcs amend modify existing patch
darcs help get help

Interactive hotkeys

Most commands show an interactive selection interface. The most basic keys are: