Subject: Re: Unable to checkout a particular SVN revision

From: Daniele Segato <[email-masked]>
Date: Sun, 29 Nov 2009 17:50:11 +0100

Il giorno ven, 27/11/2009 alle 18.05 -0800, Marc Liyanage ha scritto:
> I'm trying to clone a specific SVN revision with git-svn:
> 
>     git svn clone -r 12345 https://host/svn/foo/branches/bar xyz
> 
> but it doesn't check out any files, I see just this:
> 
>     Initialized empty Git repository in /Users/liyanage/Desktop/xyz/.git
> 
> If I try the same thing with SVN like this:
> 
>     svn co -r 12345 https://host/svn/foo/branches/bar xyz
>     
> then I get what I expect, it checks out all the files and "svn info" gives me this revision.
> 
> 
> I think it's because this particular revision wasn't committed on this branch, i.e. it doesn't show up in "svn log". If I try a revision that is listed in the log, it works as expected.
> 
> 
> Is there a way to make this work?

You had to understand the difference between a distributed version
control system (git) and a centralized version control system (svn).

On SVN there is a central repository and all user checkout a SINGLE
revision at a time, if they want to switch to another revision/branch
they had to update the local files communicating with the central
repository (can't work offline)

On Git you clone the ENTIRE history of a repository and you keep it
(all) locally. If you want to switch to another "revision" or branch you
can do it locally without interacting over network with a remote
repository, if you want to commit you can do it locally and the first
time you got connected to the network you can push your change to the
remote repository and pull others changes.

Git-SVN is a tool that allow you to interact with an SVN repository
using Git as client: the cool thing is that you get a lot of the
features of a distributed repository even if you are interacting with a
centralized one.
The bad news is that cloning the first time is really really slow: this
is because SVN has not been wrote to support distributed repository and
is not optimized to allow cloning of all the history.

to made thinks clearer:

SVN:

svn checkout -r <revision> <url> # this connect to <url> and download
that revision locally

GIT:

git svn clone <url> -T trunk -t tags -b branches # this connect to <url>
and start from revision 1 to the last cloning all the repository
(supposing you have a standard SVN structure with trunk/tags/branches)

this could keep a lot of time if it is a big repository (even days)

but when it is done you can checkout any revision:

git checkout <your-revision-commit>

git doesn't store the history as SVN do, revision numbers does NOT make
sense in a distributed environment... it just keep revision numbars
inside commits comments.. so you'll first had to search your revision
number into the git log history and then checkout the corresponding
commit.

Git is NOT another SVN client, is a completely different way of doing
versioning and you had to understand this and stop trying to use git as
you use svn until now