From: Avery Pennarun <apenwarr@gmail.com>
To: Lachlan Deck <lachlan.deck@gmail.com>
Cc: git list <git@vger.kernel.org>
Subject: Re: git svn branch tracking + ignore paths
Date: Wed, 28 Oct 2009 12:00:59 -0400 [thread overview]
Message-ID: <32541b130910280900p421e69b1nbcd8dcfa211521ac@mail.gmail.com> (raw)
In-Reply-To: <19979334-07EB-48CA-8E62-4ECC5E1FA51C@gmail.com>
On Wed, Oct 28, 2009 at 1:59 AM, Lachlan Deck <lachlan.deck@gmail.com> wrote:
> On 28/10/2009, at 4:20 PM, Avery Pennarun wrote:
>> So which are the files you don't want to import from trunk? It
>> doesn't sound like there are any... so it's getting simpler already.
>
> There are. I've currently (as a workaround) done the following within the
> main branch:
> add the following to .git/info/exclude
> .settings
> target
> .classpath
> .project
>
> The last two of these has no effect of course because .project and
> .classpath files already exist -- and thus are marked as modified. So I'm
> currently doing a git stash && git svn rebase && git svn dcommit && git
> stash pop
>
> I'm also wanting to exclude 'lib' folders from trunk (as these are not
> needed).
The problem is that as your branch diverges from what you *actually*
want to commit, it becomes exponentially more complicated to figure
out what you *do* want to commit.
Note that if you're planning to share your git project with other
people anyway, then you have an additional problem: you're using git
svn rebase, which is almost useless for sharing with other people
(other than through svn, of course), for the same reason any git
rebase is.
One option you have is to maintain two branches:
1. (git-svn) The git-svn trunk, which contains only stuff you want upstream
2. (master) Your live branch, which contains everything from (1) plus
your local customizations.
When you want to fetch from svn, you do this:
git checkout master
git svn fetch git-svn
git merge git-svn
When you want to push to svn, you do this:
git checkout git-svn
git merge --squash --no-commit master
(now undo your local customizations)
git commit
git svn dcommit
git checkout master
git merge git-svn
Note that master never gets rebased, only merged. If you can write a
simple script for "undo your local customizations" - such as reverting
a particular commit, for example - then you can put the above in a
shell script and it should work fine most of the time.
Good luck.
Avery
next prev parent reply other threads:[~2009-10-28 16:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-27 23:00 git svn branch tracking + ignore paths Lachlan Deck
2009-10-27 23:16 ` Avery Pennarun
2009-10-28 3:00 ` Lachlan Deck
2009-10-28 5:20 ` Avery Pennarun
2009-10-28 5:59 ` Lachlan Deck
2009-10-28 16:00 ` Avery Pennarun [this message]
2009-10-29 1:53 ` Lachlan Deck
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=32541b130910280900p421e69b1nbcd8dcfa211521ac@mail.gmail.com \
--to=apenwarr@gmail.com \
--cc=git@vger.kernel.org \
--cc=lachlan.deck@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).