threads / discuss / 14208

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

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

## tl;dr

4 messages between Jun 29, 2008 and Jun 29, 2008.

replies: 3people: 3as markdown or json

Boaz Harrosh· Jun 29, 2008, 11:55 UTC · re: Erez Zilber · lore

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

Erez Zilber wrote:
Show 10 quoted lines
> I could clone the remote repository and use Linux's diff, but I prefer
> to do it the right way (if possible).
> 
> Thanks,
> Erez
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
I use git-remote add
and git-diff that_remote/that_branch
then from time to time "git-remote update" to update on remote progress
Boaz
Erez Zilber· Jun 29, 2008, 12:19 UTC · re: Boaz Harrosh · lore

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

On Sun, Jun 29, 2008 at 2:55 PM, Boaz Harrosh <bharrosh@panasas.com> wrote:
Show 19 quoted lines
> Erez Zilber wrote:
>> I could clone the remote repository and use Linux's diff, but I prefer
>> to do it the right way (if possible).
>>
>> Thanks,
>> Erez
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
> I use git-remote add
>
> and git-diff that_remote/that_branch
>
> then from time to time "git-remote update" to update on remote progress
>
> Boaz
thanks!
Jakub Narebski· Jun 29, 2008, 12:38 UTC · re: Erez Zilber · lore

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

"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

← back to recent threads