git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Avery Pennarun <apenwarr@gmail.com>
To: Ricky Clarkson <ricky.clarkson@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: I've been pushing to one branch from both git-svn and git
Date: Tue, 4 May 2010 12:34:31 -0400	[thread overview]
Message-ID: <w2s32541b131005040934o339e3e79vf386427ed282ce64@mail.gmail.com> (raw)
In-Reply-To: <z2h7eeb06461005040443ib2fb7405i39e7d5b4220bfb08@mail.gmail.com>

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

  reply	other threads:[~2010-05-04 16:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2010-05-05  9:09   ` Ricky Clarkson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=w2s32541b131005040934o339e3e79vf386427ed282ce64@mail.gmail.com \
    --to=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ricky.clarkson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).