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

Re: Is there a way to diff between a local repository and a remote one?

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 29, 2008, 12:38 UTC
Message-ID
<m38wwoifi7.fsf@localhost.localdomain>
In-Reply-To
<ce513bcc0806290429r1982fbf2i4c9a8258bc8db3c@mail.gmail.com>
"Erez Zilber" <erezzi.list@gmail.com> writes:
> Is there a way to diff between a local repository and a remote one?
>
> I could clone the remote repository and use Linux's diff, but I prefer
> to do it the right way (if possible).

There is no way to do this remotely; you have to download either snapshot (tarball) of remote repository (either from gitweb interface or other web interface if snapshot feature is enabled, or using "git archive --remote=<repo> <version>" (where <version> might be "HEAD") if it is enabled on remote), or fetch / shallow fetch / shallow clone of repository.

If local repository you want to diff is related to remote repository, the simplest way would be to fetch (or shallow fetch) the repository you want to compare into your repository, either using

  $ git remote add -f <nick> <URL>
  $ git diff HEAD <nick> #; or <nick>/HEAD, or <nick>/master
or
  $ git fetch --no-tags <URL> <branch> #; you can add --depth=1
  $ git diff HEAD FETCH_HEAD

(of course all above being in local repository; you can replace HEAD by local revision you want to compare)

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Erez Zilber
Message 4 of 4 in “Is there a way to diff between a local repository and a remote one?”
  1. Erez ZilberJun 29, 2008
  2. Boaz HarroshJun 29, 2008
  3. Erez ZilberJun 29, 2008
  4. Jakub NarebskiJun 29, 2008

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.