All of lore.kernel.org
 help / color / mirror / Atom feed
* I've been pushing to one branch from both git-svn and git
@ 2010-05-04 11:43 Ricky Clarkson
  2010-05-04 16:34 ` Avery Pennarun
  0 siblings, 1 reply; 3+ messages in thread
From: Ricky Clarkson @ 2010-05-04 11:43 UTC (permalink / raw)
  To: git

Hi,

I have a git repository we'll call the git svn repo, in which I only
perform git svn fetch and git push bare.

bare is a bare git repository, which I push to from a local
repository.  The mistake I've been making is to push to the branch
'trunk' in bare, from my local repository.  The reason this is a
mistake is because git push bare from the git svn repo also pushes to
there.

Today I've been forced to learn of my mistake, as I cannot push from
the git svn repo without possibly losing commits.  It turns out (which
is probably obvious to you all) that I should have been pushing to,
say, bare's 'master' branch instead of its trunk one.

I don't intend to push back to svn from any of these repos, but I
would like to be able to continue pulling changes from svn at least
for the time being.  What should I do?

Thanks,
Ricky.

--
Ricky Clarkson
Java and Scala Programmer, AD Holdings
+44 1928 706373
Skype: ricky_clarkson
Google Talk: ricky.clarkson@gmail.com
Google Wave: ricky.clarkson@googlewave.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: I've been pushing to one branch from both git-svn and git
  2010-05-04 11:43 I've been pushing to one branch from both git-svn and git Ricky Clarkson
@ 2010-05-04 16:34 ` Avery Pennarun
  2010-05-05  9:09   ` Ricky Clarkson
  0 siblings, 1 reply; 3+ messages in thread
From: Avery Pennarun @ 2010-05-04 16:34 UTC (permalink / raw)
  To: Ricky Clarkson; +Cc: git

On Tue, May 4, 2010 at 7:43 AM, Ricky Clarkson <ricky.clarkson@gmail.com> wrote:
> I have a git repository we'll call the git svn repo, in which I only
> perform git svn fetch and git push bare.
>
> bare is a bare git repository, which I push to from a local
> repository.  The mistake I've been making is to push to the branch
> 'trunk' in bare, from my local repository.  The reason this is a
> mistake is because git push bare from the git svn repo also pushes to
> there.
>
> Today I've been forced to learn of my mistake, as I cannot push from
> the git svn repo without possibly losing commits.  It turns out (which
> is probably obvious to you all) that I should have been pushing to,
> say, bare's 'master' branch instead of its trunk one.
>
> I don't intend to push back to svn from any of these repos, but I
> would like to be able to continue pulling changes from svn at least
> for the time being.  What should I do?

If you don't intend to push back to svn, then life is relatively simple.

First, on your PC where you've been making other commits, rename the
trunk branch to master and push that:

   git branch -m trunk master
   git push bare master

Then delete the 'trunk' branch on bare, and re-push it from the git svn repo:

   git push bare :trunk
   git push bare trunk

And probably you'll go back to your PC and merge the latest trunk into
your master:

   git pull bare trunk
     # resolve any conflicts
   git push bare master

Have fun,

Avery

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: I've been pushing to one branch from both git-svn and git
  2010-05-04 16:34 ` Avery Pennarun
@ 2010-05-05  9:09   ` Ricky Clarkson
  0 siblings, 0 replies; 3+ messages in thread
From: Ricky Clarkson @ 2010-05-05  9:09 UTC (permalink / raw)
  To: Avery Pennarun; +Cc: git

Hi Avery,

Thanks.  I solved it a slightly different but hopefully equivalent way:

Create a new branch named master locally, and merge the changes from
trunk into it (I don't think any merge was needed as it would be a
copy of trunk).  Push master.  From the git svn repo, git push -f
origin, then git pull in the local repo and git merge trunk (the
current branch is master).

Ricky.

--
Ricky Clarkson
Java and Scala Programmer, AD Holdings
+44 1928 706373
Skype: ricky_clarkson
Google Talk: ricky.clarkson@gmail.com
Google Wave: ricky.clarkson@googlewave.com



On 4 May 2010 17:34, Avery Pennarun <apenwarr@gmail.com> wrote:
> On Tue, May 4, 2010 at 7:43 AM, Ricky Clarkson <ricky.clarkson@gmail.com> wrote:
>> I have a git repository we'll call the git svn repo, in which I only
>> perform git svn fetch and git push bare.
>>
>> bare is a bare git repository, which I push to from a local
>> repository.  The mistake I've been making is to push to the branch
>> 'trunk' in bare, from my local repository.  The reason this is a
>> mistake is because git push bare from the git svn repo also pushes to
>> there.
>>
>> Today I've been forced to learn of my mistake, as I cannot push from
>> the git svn repo without possibly losing commits.  It turns out (which
>> is probably obvious to you all) that I should have been pushing to,
>> say, bare's 'master' branch instead of its trunk one.
>>
>> I don't intend to push back to svn from any of these repos, but I
>> would like to be able to continue pulling changes from svn at least
>> for the time being.  What should I do?
>
> If you don't intend to push back to svn, then life is relatively simple.
>
> First, on your PC where you've been making other commits, rename the
> trunk branch to master and push that:
>
>   git branch -m trunk master
>   git push bare master
>
> Then delete the 'trunk' branch on bare, and re-push it from the git svn repo:
>
>   git push bare :trunk
>   git push bare trunk
>
> And probably you'll go back to your PC and merge the latest trunk into
> your master:
>
>   git pull bare trunk
>     # resolve any conflicts
>   git push bare master
>
> Have fun,
>
> Avery
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-05  9:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-04 11:43 I've been pushing to one branch from both git-svn and git Ricky Clarkson
2010-05-04 16:34 ` Avery Pennarun
2010-05-05  9:09   ` Ricky Clarkson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.