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

Re: connecting existing local git repository to svn

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jan 27, 2009, 13:02 UTC
Message-ID
<497F05D7.3060607@drmicha.warpmail.net>
In-Reply-To
<497F0280.2070400@gmail.com>
Ittay Dror venit, vidit, dixit 01/27/09 13:48:
Show 25 quoted lines
> 
> Sverre Rabbelier wrote:
> 
>> On Tue, Jan 27, 2009 at 11:41, Ittay Dror <ittay.dror@gmail.com> wrote:
>>   
>>> git: ----v1----v2----v3--v4---v5
>>> svn:                     \---v4--v5
>>>
>>> so the svn history starts from v3, but the git history remains unchanged.
>>>     
>> Create the new branch from v3 then, and use git svn to pull it in.
>> Then you can do 'git rebase that-svn-branch' on your git branch to put
>> all commits (not as one big commit) on top of that branch point. Now
>> you 'git checkout' that-svn-branch and do 'git reset --hard
>> the-git-branch', which should now consist of
>> v1--v2--v3--v4(git)--v5(git), etc. If you do 'git svn dcommit' from
>> the that-svn-branch now it should dcommit to svn each of your git
>>   
> sorry, my ascii art was confusing:
> 
> git: ----v1----v2----v3--v4---v5
> svn: v1-4---v5
> 
> v1-4 is v1 to v4 squashed together. (e.g., if i added a file in v2 and 
> removed in v3 it will not appear in svn history)

Well, for git and svn "revisions" are really "versions" of the complete tree, not changesets. Have messed around with hg lately? ;)

On the other hand, a commit that introduces a new version is the difference with respect to the previous "version".

Ususally it's clear what is meant, but you seem to mix both notions.

So, if v? denotes a version, then v4 is the result of all commits leading up to v4. It *is* v4. "squashing" applies only to commits ("changes").

In any case, Sverre's as well as my suggestions should do what you want. Why not try it out if you doubt it?

Cheers, Michael

Previous: Ittay DrorNext: Ittay Dror
Message 6 of 7 in “connecting existing local git repository to svn”
  1. Ittay DrorJan 27, 2009
  2. Michael J GruberJan 27, 2009
  3. Ittay DrorJan 27, 2009
  4. Sverre RabbelierJan 27, 2009
  5. Ittay DrorJan 27, 2009
  6. Michael J GruberJan 27, 2009
  7. Ittay DrorJan 28, 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.