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

Re: Unable to checkout a particular SVN revision

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Nov 28, 2009, 15:03 UTC
Message-ID
<4B113BAD.8090604@drmicha.warpmail.net>
In-Reply-To
<718EEBA2-FA4B-402D-B2FC-A8F14D79F6FF@entropy.ch>
Marc Liyanage venit, vidit, dixit 28.11.2009 03:05:
Show 20 quoted lines
> 
> 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?

No. Because "this" is different in the two cases above: "git svn clone" clones the history of an svn repo, and the command above clearly gives you the history of that branch in the specified revision range (consisting of 1 revision). It is empty.

"svn co" checks out a specific revision.
You cannot "clone" a revision.

If all you want is a git repository with no history, but with the files of a specific svn revision, you can svn co -r 12345 https://host/svn/foo/branches/bar xyz cd xyz git init find . -name .svn -print0 | xargs -0 rm -Rf git add . git commit -m "r12345 of branch bar"

Michael
Previous: Marc LiyanageNext: Marc Liyanage
Message 2 of 5 in “Unable to checkout a particular SVN revision”
  1. Marc LiyanageNov 28, 2009
  2. Michael J GruberNov 28, 2009
  3. Marc LiyanageNov 29, 2009
  4. Daniele SegatoNov 29, 2009
  5. Marc LiyanageDec 1, 2009

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.