darcs add X
git add X(but git recurses by default)
darcs revert X
git checkout -- X
git diff HEAD
darcs wh -s
darcs rec X
git commit -p X
git add -p, if you want to stage changes first.
git diff --cachedshows what you've got staged.
git commit -aautomatically adds modified/deleted files.
darcs changes --last 10
git log -10
To remove a bad last commit,
git reset --soft HEAD^, then
git commit -c ORIG_HEAD(the
-c ...starts with the old commit message).
To add a change you forgot, stage it, then
git commit --amend, which merges the current index into the last commit.
git push [origin]
git reset --hard HEADon master to update working copy — but that will discard local changes! See
git-push.txtin the Git distribution for how to do this automatically with a hook, if safe.
Converting a Darcs repo to Git
I've written a more detailed article on this.
Thoughts on Darcs vs. Git
Git's underlying model seemed more complicated than Darcs' when I first started using it — probably because I started by reading the man pages — but it's actually pretty simple. I still slightly prefer tracking patches (Darcs-style) to tracking revisions (Git-style), but you can do the same stuff in the two systems.
I think it's a pity that
git pullaren't symmetrical. (Fetch/push are closer.)
I find git's heuristic copy/rename detection a bit magical for my tastes. It generally works OK, but sometimes I'd like to be able to say "this new file really is based on this old one, even though I had to change a lot to make it work in its new location", for the sake of being able to follow changes in the history.
git rebase -iis absolutely git's killer feature, since it lets you produce nice clean series of patches.
Interactive modes for more things in git would be nice — it's pervasive in Darcs (for push, pull, revert, etc. as well as record).