RosettaStone

Translations

Initialising and cloning

concept darcs git hg
new repository init init init
copy repository clone clone clone
branch see checkout branch branch
switch branch na [1] checkout update
  • [1] No in-repo branching yet, see issue555

Adding, moving, removing files

concept darcs git hg
track file add add add
copy file na just copy it, git might notice copy
move/rename file move (aka mv) mv rename (aka mv)

Inspecting the working directory

concept darcs git hg
working dir status whatsnew -s status status
high-level local diff whatsnew na na
diff local diff [1] diff diff
  • [1] we tend to use the high-level local diff (darcs whatsnew) instead. This displays the patches themselves (eg ‘mv foo bar’) and not just their effects (eg ‘rm foo’ followed by “add bar”)

Committing

concept darcs git hg
commit locally record commit commit
commit to repo see push/send see push see push
amend commit amend commit –amend ?
tag changes/revisions tag tag tag

See below for comments on record vs commit.

Inspecting the repository history

concept darcs git hg
log log log log
log with diffs log -v log -p log -p
manifest show files ls-files manifest
summarise outgoing changes push –dry-run log origin/master .. outgoing
summarise incoming changes pull –dry-run log ..origin/mast er incoming
diff repos or versions diff diff incoming /outgoing/dif f -r
blame/annotate annotate blame? annotate

Undoing

concept darcs git hg
revert a file revert foo checkout foo revert foo
revert full working copy revert reset –hard revert -a
undo commit (leaving working copy untouched) unrecord reset –soft rollback
amend commit amend commit –amend ?
destroy last patch/ changeset obliterate delete the commit strip [1]
destroy any patch/ changeset obliterate rebase -i, delete the commit strip [1]
create anti-changeset rollback revert backout
  • [1] requires extension (mq for strip)

Collaborating with others

concept darcs git hg
update from repo see pull remote update pull -u
pull pull pull pull
push push push push
send by mail send send-email email [1]
  • [1] requires extension (patchbomb for email)

Advanced usage

concept darcs git hg
port commit to X rebase rebase/cherry -pick transplant

Discrepencies between DVCS

Git has the notion of an index (which affects the meanings of some of the commands), Darcs just has its simple branch-is-repo-is-workspace model.

Superficial differences:

  • git revert is like darcs rollback
  • git reset is like darcs revert

See also