# Git vs svn. Is ... possible ?

5 messages from 2008-03-28 to 2008-03-31. Participants: Rafał Mużyło, Adam Piatyszek, Bill Lear, Theodore Tso, John Goerzen.
Thread: https://gitlist.dev/t/12901

## Rafał Mużyło, 2008-03-28 13:24

Subject: Git vs svn. Is ... possible ?
Message-ID: <20080328132438.GA32646@blackspire>
URL: https://gitlist.dev/e/20080328132438.GA32646%40blackspire

```
Well, the actual question is:
In svn I can do a remote diff (diff between two remote revisions) without
having to do a checkout, is this possible for git ?

```

## Adam Piatyszek, 2008-03-28 13:36

Subject: Re: Git vs svn. Is ... possible ?
Message-ID: <47ECF459.2040500@users.sourceforge.net>
URL: https://gitlist.dev/e/47ECF459.2040500%40users.sourceforge.net
In-Reply-To: <20080328132438.GA32646@blackspire>

```
Hi Rafał,

* Rafa? Mu?y?o [28 III 2008 14:24]:
> Well, the actual question is:
> In svn I can do a remote diff (diff between two remote revisions) without
> having to do a checkout, is this possible for git ?

The question makes no sense to me. Git by design is a distributed SCM 
tool, so there is no such thing like "remote revisions". You can have 
tracking branches (clones) of some remote repositories, but all the 
commits on such branches are also stored locally. So you have full 
access to them, even without a permanent connection to such remote 
repositories.

And answering to the second part of your question: Yes, you can do "git 
diff" operation between any of the commits in the repository you are 
working with. No need to checkout before. You can perform "git diff" 
even on a bare repository without the working three.

Please refer to "man git-diff" for more info.

BR,
/Adam


PS. The encoding you used for your message is not playing well with the 
Polish accented characters in your name ;)

-- 
.:.  Adam Piatyszek (ediap)  .:.....................................:.
.:.  ediap@users.sourceforge.net  .:................................:.

```

## Bill Lear, 2008-03-28 14:09

Subject: Re: Git vs svn. Is ... possible ?
Message-ID: <18412.64512.269165.652979@lisa.zopyra.com>
URL: https://gitlist.dev/e/18412.64512.269165.652979%40lisa.zopyra.com
In-Reply-To: <20080328132438.GA32646@blackspire>

```
On Friday, March 28, 2008 at 14:24:38 (+0100) =?utf-8?B?UmFmYcWCIE11xbx5xYJv?= writes:
>Well, the actual question is:
>In svn I can do a remote diff (diff between two remote revisions) without
>having to do a checkout, is this possible for git ?

I'm not sure what you mean by "two remote revisions".  Do you mean you
are on machine X, and you want to diff content on machine Y and
machine Z?  If so, you could probably do that in git fairly easily
with some script magic that would fetch the remote branches into local
tracking branches, and then diff them.  This would not literally
require you to perform a "checkout", but you would need a git repo
(actually a script could take care of creating a temporary repo, fetch
into it, do the diff and then remove the temporary repo when done).

If you are talking about having an existing repo on machine X and
diffing content that is on machine Y, you can do a fetch followed by a
diff, so in that case you can do it literally "without having to do a
checkout".  Example: if you are working on master and want to see what
is different between what you have and what is in a remote repo you
are tracking, you can do "git fetch" then "git diff origin/master".


Bill

```

## Theodore Tso, 2008-03-28 14:31

Subject: Re: Git vs svn. Is ... possible ?
Message-ID: <20080328143114.GL7202@mit.edu>
URL: https://gitlist.dev/e/20080328143114.GL7202%40mit.edu
In-Reply-To: <47ECF459.2040500@users.sourceforge.net>

```
On Fri, Mar 28, 2008 at 02:36:25PM +0100, Adam Piatyszek wrote:
>
> The question makes no sense to me. Git by design is a distributed SCM tool, 
> so there is no such thing like "remote revisions". You can have tracking 
> branches (clones) of some remote repositories, but all the commits on such 
> branches are also stored locally. So you have full access to them, even 
> without a permanent connection to such remote repositories.
>

It would certainly be possible to *implement* such a thing, but first
question would be, "why would you want to".  One of the things that
makes git so nice is that repositories don't take that much space, and
if you have a local repository (or no network access at all) it's much
faster to consult the local repository at all.

In fact, with svn, I normally consider it a bug that you *have* to
consult the remote repository to do a diff between two arbitrary
revisions.

						- Ted

```

## John Goerzen, 2008-03-31 15:41

Subject: Re: Git vs svn. Is ... possible ?
Message-ID: <slrnfv21gk.b4c.jgoerzen@katherina.lan.complete.org>
URL: https://gitlist.dev/e/slrnfv21gk.b4c.jgoerzen%40katherina.lan.complete.org
In-Reply-To: <20080328132438.GA32646@blackspire>

```
On 2008-03-28, Rafa? Mu?y?o <galtgendo@o2.pl> wrote:
> Well, the actual question is:
> In svn I can do a remote diff (diff between two remote revisions) without
> having to do a checkout, is this possible for git ?

You can craft URLs to gitweb in specific ways to do this.  For
instance:

http://git.complete.org/branches/redmine-integration/?a=commitdiff_plain;h=fb-bug-738-projects-block;hp=upstream

Shows the diff from branch upstream to branch
fb-bug-738-projects-block.  You can replace the branch names with the
full 40-character SHA1 ids as well.

Leave off the "_plain" and you get diff highlighting.

The header at the top of this thing is going to be a bit misleading,
but the content is what you want.

-- John

```
