how to go back to the last saved version of the file?

darcs revert file <FILENAME>


how to ignore some files?

to have darcs always ignore certain files you can use a _darcs/pref/boring file. to see also what boring files darcs is not managing, use darcs whatsnew -ls --boring

in the boringfile, if you want to match a directory and its contents, use a regex like: ^foo(/|$)

in particular, be aware that there is no / or ./ at the beginning of the paths that darcs matches against


how to create a branch in Darcs?

short answer: no way

in Darcs branches and repositories are the same thing. so to create a branch, you have to use

darcs get
or
darcs get --lazy

this does create a new directory - if you have a lot of branches, it could be a good idea to have a single container directory and subdirectories underneath it for all the branches you use


darcs changes will show you your patches

then it is time to record changes as a patch the command darcs record walks you through all your local changes and asks you whether they should be part of the patch

if you want record all changes then use darcs record -am 'any patch comments here'


darcs has tags, patches, and changesets, but not versions, and it has get instead of checkout


   darcs get --to-patch='PATCHNAME' <REPO-DIR>
   darcs get --tag <TAGNAME> <REPO-DIR>
darcs put <REPO-DIR> creates a copy of the current repository

command darcs whatsnew lists unrecorded changes to the working tree

if you later discover that your patch is

  • incomplete,
  • missing a file, or
  • contains an error,
    then you can use darcs amend-record to correct it

    if you think that things are very wrong, then darcs unrecord deletes the patch entirely

    none of the above commands change your working directory


  • how do I go back to an older version of my repository?

    short answer: darcs get --to-match 'typeofmatch paramofmatch'
    typeofmatch : name, exact, hash, author, date

    long answer: what exactly do you mean by go back to an older version?

    suppose you have a repository A B C D. what does it mean "to go back to a previous 'version?'"

    one way might be to do something like darcs get . --to-match 'name B' temp/ which will give you in directory 'temp' the sequence (A B) from current repo

    but what if instead of going back to B, you just wanted to get rid of B?

    darcs is quite happy to do that. you could darcs get a copy of the repository and then do darcs obliterate --match 'name B' to just get rid of patch B


    to set remote repository: darcs put --set-default </path/to/remote/repo> and after that darcs push

    if you add or remove files or directories to/from the repository darcs add FILENAME or darcs remove FILENAME this does not actually create or delete files; you have to do that yourself

    if you move a file or directory darcs mv FROM TO this does actually perform the move

    if you want to see which patches are missing from your or the remote repository, you can run

    
      # patches you are missing
      darcs pull --dry-run
      # patches the remote repository is missing
      darcs push --dry-run
    

    to reproduce the state of a repository 'R' as it is at tag 't', use the command

    
      darcs get -tag t R
    

    the command darcs show tags lists all tags in the current repository


    if you want to get a specific version of a repository, you have a few options

    you can either use the --tag, --to-patch or --to-match options, or you can use the --context=FILENAME option, which specifies a file containing a context generated with darcs changes --context


    how do I see different patches if their names are not unique?

    use the hash part of the xml output (the gz extension can be omitted):
    
      darcs changes --xml-output