~jan0sch/darcs-book
Showing details for patch 12283e3e17d51876e19b02bec1d93c86940aa665.
diff -rN -u old-darcs-book/en/05-a-little-help-from-my-friends.md new-darcs-book/en/05-a-little-help-from-my-friends.md --- old-darcs-book/en/05-a-little-help-from-my-friends.md 2024-11-24 01:57:18.197998931 +0000 +++ new-darcs-book/en/05-a-little-help-from-my-friends.md 2024-11-24 01:57:18.197998931 +0000 @@ -243,6 +243,43 @@ `pull`. This saves us from memorizing all the remote repositories we are working with and thus makes life a little easier for us. +Traveling without moving +------------------------ + +Sometimes we don't actually want to `push` or `pull` but rather just want to see +what would happen if we were to do either of these operations. One of these +situations might be that we want to know what changes we have that do not exist +in the remote repository that we want to `push` to, or the set changes we would +`pull` in from another repository. Both `pull` and `push` offer a `--dry-run` +flag to suppress the effects of the actual operation. When we issue a command +using the `--dry-run` flag it will only report the actions it *would* do without +actually performing them. + +``` +$ darcs pull --dry-run raichoo@hub.darcs.net:darcs-fish +Would pull from "raichoo@hub.darcs.net:darcs-fish"... +Would pull the following changes: +patch 0dd46bd7a710d66136d7293b667984bdaffb1509 +Author: raichoo@example.com +Date: Mon Jun 18 12:31:32 CEST 2018 + * display move + +Making no changes: this is a dry run. +``` + +You can see that there is one change in the remote repository that I do not have +in my local copy yet. I can now decide if I really want to `pull` this change or +not. + +Instead of using `--dry-run` you can of course always say `no` to all of the +changes when the interactive prompt asks you if you would like to pull them in. +Whether you prefer this or `--dry-run` is totally up to you. + +As a side note, the `--dry-run` flag is supported by other commands as well, it +is a common way to tell an operation that it should only show me what its +intentions are rather than actually performing an action. You can check the help +section of the individual commands to find out of they support this flag. + Annotate --------