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

4 messages from 2008-06-29 to 2008-06-29. Participants: Erez Zilber, Boaz Harrosh, Jakub Narebski.
Thread: https://gitlist.dev/t/14208

## Erez Zilber, 2008-06-29 11:29

Subject: Is there a way to diff between a local repository and a remote one?
Message-ID: <ce513bcc0806290429r1982fbf2i4c9a8258bc8db3c@mail.gmail.com>
URL: https://gitlist.dev/e/ce513bcc0806290429r1982fbf2i4c9a8258bc8db3c%40mail.gmail.com

```
I could clone the remote repository and use Linux's diff, but I prefer
to do it the right way (if possible).

Thanks,
Erez

```

## Boaz Harrosh, 2008-06-29 11:55

Subject: Re: Is there a way to diff between a local repository and a remote one?
Message-ID: <4867783C.1010408@panasas.com>
URL: https://gitlist.dev/e/4867783C.1010408%40panasas.com
In-Reply-To: <ce513bcc0806290429r1982fbf2i4c9a8258bc8db3c@mail.gmail.com>

```
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

```

## Erez Zilber, 2008-06-29 12:19

Subject: Re: Is there a way to diff between a local repository and a remote one?
Message-ID: <ce513bcc0806290519u2e97f276t9fbe8c87715488ea@mail.gmail.com>
URL: https://gitlist.dev/e/ce513bcc0806290519u2e97f276t9fbe8c87715488ea%40mail.gmail.com
In-Reply-To: <4867783C.1010408@panasas.com>

```
On Sun, Jun 29, 2008 at 2:55 PM, Boaz Harrosh <bharrosh@panasas.com> wrote:
> 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, 2008-06-29 12:38

Subject: Re: Is there a way to diff between a local repository and a remote one?
Message-ID: <m38wwoifi7.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m38wwoifi7.fsf%40localhost.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

```
