* connecting existing local git repository to svn
@ 2009-01-27 4:10 Ittay Dror
2009-01-27 10:35 ` Michael J Gruber
0 siblings, 1 reply; 8+ messages in thread
From: Ittay Dror @ 2009-01-27 4:10 UTC (permalink / raw)
To: git
Hi,
I'd like to create a branch in a subversion repository so that I can
work with git-svn on it.
My git repository is already with a history, that I don't want to
replicate to subversion, I want to start with subversion having just the
latest revision and then continue from there normally (git svn
dcommit/rebase).
How can I do that?
Thanks,
Ittay
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: connecting existing local git repository to svn
2009-01-27 4:10 connecting existing local git repository to svn Ittay Dror
@ 2009-01-27 10:35 ` Michael J Gruber
2009-01-27 10:41 ` Ittay Dror
0 siblings, 1 reply; 8+ messages in thread
From: Michael J Gruber @ 2009-01-27 10:35 UTC (permalink / raw)
To: Ittay Dror; +Cc: git
Ittay Dror venit, vidit, dixit 01/27/09 05:10:
> Hi,
>
>
> I'd like to create a branch in a subversion repository so that I can
> work with git-svn on it.
>
>
> My git repository is already with a history, that I don't want to
> replicate to subversion, I want to start with subversion having just the
> latest revision and then continue from there normally (git svn
> dcommit/rebase).
>
>
> How can I do that?
Create the svn branch (with svn) and "git svn clone". Pull in your git
branch under a new name (if that is what you want).
Now, you can e.g. "git merge -s theirs" your other git branch into
master, git svn rebase and dcommit. Untested, but comes with best wishes ;)
Do you want to discard your existing git history completely?
Cheers,
Michael
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: connecting existing local git repository to svn
2009-01-27 10:35 ` Michael J Gruber
@ 2009-01-27 10:41 ` Ittay Dror
2009-01-27 12:16 ` Sverre Rabbelier
0 siblings, 1 reply; 8+ messages in thread
From: Ittay Dror @ 2009-01-27 10:41 UTC (permalink / raw)
To: Michael J Gruber; +Cc: git
Michael J Gruber wrote:
> Ittay Dror venit, vidit, dixit 01/27/09 05:10:
>
>> Hi,
>>
>>
>> I'd like to create a branch in a subversion repository so that I can
>> work with git-svn on it.
>>
>>
>> My git repository is already with a history, that I don't want to
>> replicate to subversion, I want to start with subversion having just the
>> latest revision and then continue from there normally (git svn
>> dcommit/rebase).
>>
>>
>> How can I do that?
>>
>
> Create the svn branch (with svn) and "git svn clone". Pull in your git
> branch under a new name (if that is what you want).
> Now, you can e.g. "git merge -s theirs" your other git branch into
> master, git svn rebase and dcommit. Untested, but comes with best wishes ;)
>
but wouldn't that create a revision in svn for each commit in git?
what i want is something like:
git: ----v1----v2----v3--v4---v5
svn: \---v4--v5
so the svn history starts from v3, but the git history remains unchanged.
ittay
> Do you want to discard your existing git history completely?
>
> Cheers,
> Michael
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: connecting existing local git repository to svn
2009-01-27 10:41 ` Ittay Dror
@ 2009-01-27 12:16 ` Sverre Rabbelier
2009-01-27 12:48 ` Ittay Dror
0 siblings, 1 reply; 8+ messages in thread
From: Sverre Rabbelier @ 2009-01-27 12:16 UTC (permalink / raw)
To: Ittay Dror; +Cc: Michael J Gruber, git
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
commits individually. Of course, don't forget to make a backup before
you start messing around :P.
--
Cheers,
Sverre Rabbelier
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: connecting existing local git repository to svn
2009-01-27 12:16 ` Sverre Rabbelier
@ 2009-01-27 12:48 ` Ittay Dror
2009-01-27 13:02 ` Michael J Gruber
0 siblings, 1 reply; 8+ messages in thread
From: Ittay Dror @ 2009-01-27 12:48 UTC (permalink / raw)
To: Sverre Rabbelier; +Cc: Michael J Gruber, git
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)
hope it is clear now.
ittay
> commits individually. Of course, don't forget to make a backup before
> you start messing around :P.
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: connecting existing local git repository to svn
2009-01-27 12:48 ` Ittay Dror
@ 2009-01-27 13:02 ` Michael J Gruber
2009-01-28 5:26 ` Ittay Dror
0 siblings, 1 reply; 8+ messages in thread
From: Michael J Gruber @ 2009-01-27 13:02 UTC (permalink / raw)
To: Ittay Dror; +Cc: Sverre Rabbelier, git
Ittay Dror venit, vidit, dixit 01/27/09 13:48:
>
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: connecting existing local git repository to svn
2009-01-27 13:02 ` Michael J Gruber
@ 2009-01-28 5:26 ` Ittay Dror
0 siblings, 0 replies; 8+ messages in thread
From: Ittay Dror @ 2009-01-28 5:26 UTC (permalink / raw)
Cc: git
Michael J Gruber wrote:
> Ittay Dror venit, vidit, dixit 01/27/09 13:48:
>
>> 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".
>
>
here's a new one:
initial
git: --- c1 --- c2 --- c3 --- c4
create svn:
git: --- c1 --- c2 --- c3 --- c4
svn --- c1|c2|c3|c4
where c1|c2|c3|c4 is the squashing of all commits into one. it is the
first revision in the svn repository
c1|c2|c3|c4 === r1
do some work, commit, dcommit:
git: --- c1 --- c2 --- c3 --- c4 --- c5
svn --- c1|c2|c3|c4 --- r2
where 'r2' is revision 2 of the svn repository and contains the same
changes as c5. that is diff(r2, r1) is the same as diff(c5, c4)
so the svn history starts from how the working tree looks like when it
is created and progresses from there. the git history is unaltered. i
want to keep on working on 'master' in git (and 'git log' should show
all commits as before).
> 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?
>
well, sverre's suggestion says it will dcommit each git commit
individually and i think your suggestion means i discard my git history
in the branch i'm working on.
thank you,
ittay
> Cheers,
> Michael
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* connecting existing local git repository to svn
@ 2009-01-26 19:29 Ittay Dror
0 siblings, 0 replies; 8+ messages in thread
From: Ittay Dror @ 2009-01-26 19:29 UTC (permalink / raw)
To: git
Hi,
I'd like to create a branch in a subversion repository so that I can
work with git-svn on it.
My git repository is already with a history, that I don't want to
replicate to subversion, I want to start with subversion having just the
latest revision and then continue from there normally (git svn
dcommit/rebase).
How can I do that?
Thanks,
Ittay
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-01-28 5:28 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-27 4:10 connecting existing local git repository to svn Ittay Dror
2009-01-27 10:35 ` Michael J Gruber
2009-01-27 10:41 ` Ittay Dror
2009-01-27 12:16 ` Sverre Rabbelier
2009-01-27 12:48 ` Ittay Dror
2009-01-27 13:02 ` Michael J Gruber
2009-01-28 5:26 ` Ittay Dror
-- strict thread matches above, loose matches on Subject: below --
2009-01-26 19:29 Ittay Dror
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).