git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to figure out what 'git push' would do?

From
Steffen Prohaska <prohaska@zib.de>
Date
Aug 5, 2007, 19:56 UTC
Message-ID
<515E28B6-85AF-4379-870A-CFECF19B74DE@zib.de>
In-Reply-To
<20070805173340.GA3159@steel.home>
On Aug 5, 2007, at 7:33 PM, Alex Riesen wrote:
Show 26 quoted lines
> Steffen Prohaska, Sun, Aug 05, 2007 13:37:34 +0200:
>> How can I check what a 'git push' would do, without
>> actually doing it?
>>
>> Is there something like 'git push --dry-run', similar
>> to 'rsync --dry-run'?
>
> No. It is often safe to just do git-push, unless you have naive
> developers doing pull every time some ref in your shared repo changes
> *and* expecting the result to compile (typical for CVS way of work).
> git-push will not overwrite anything, it always only forwards history.
>
> For the case you really want to know what the changes on remote repo
> will be it is possible to fetch them into the local repo first and
> compare with what you will push:
>
>     $ git fetch git://remote/path/REPO master:refs/remotes/REPO/master
>     $ gitk local..REPO/master
>
> It gives you all possible information, which may be worth that bit of
> work. Or, if you have all the remote configuration ready, it can be
> just:
>
>     $ git fetch
>     $ gitk local..REPO/master
>

That applies only for a single branch. If I prepared a couple of branches for pushing and somehow want to double check what I prepared, 'git push --dry-run' would be quite handy. I know how to handle the situation and could write a custom script that does all necessary checks. But I haven't found an out-of-the-box solution for double checking right before 'git push'

	Steffen
Previous: Julian PhillipsNext: Alex Riesen
Message 5 of 6 in “How to figure out what 'git push' would do?”
  1. Steffen ProhaskaAug 5, 2007
  2. David KastrupAug 5, 2007
  3. Alex RiesenAug 5, 2007
  4. Julian PhillipsAug 5, 2007
  5. Steffen ProhaskaAug 5, 2007
  6. Alex RiesenAug 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.