threads / discuss / 35205

previewing "git pull"

Subject: previewing "git pull"

## tl;dr

One message between Oct 26, 2013 and Oct 26, 2013.

replies: 0people: 1as markdown or json

Perry Hutchison· Oct 26, 2013, 03:23 UTC · lore

In git 1.7.0.4, what's the correct way to preview what a "git pull" would do, without actually doing it? Unlike most git subcommands, pull seems not to understand --dry-run:

$ git pull --dry-run sed: can't read {pathname suppressed}/.git/FETCH_HEAD: No such file or directory You asked to pull from the remote '--dry-run', but did not specify a branch. Because this is not the default configured remote for your current branch, you must specify a branch on the command line.

Trying the "fetch" part of pull by itself, at least fetch doesn't mistake --dry-run for a remote name, but it doesn't seem to implement it either -- instead of a report of what it would do, there's no output at all:

$ git fetch --dry-run $

I'm guessing that I may need to actually do the fetch in order for git to know what the remote has, but then how would I find out exactly what merge command "pull" would have issued (so as to try adding --dry-run to it)?

← back to recent threads