From: Jonathan Nieder <jrnieder@gmail.com>
To: Christopher Snapp <snappca@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git svn project shuffle
Date: Mon, 4 Oct 2010 13:54:24 -0500 [thread overview]
Message-ID: <20101004185424.GA6343@burratino> (raw)
In-Reply-To: <AANLkTimL18WHOrLjA5iWNcsgd6H8Eeq19LfJNjkKu_b-@mail.gmail.com>
Hi Chris,
Christopher Snapp wrote:
> # If I try to start from scratch by using git svn clone --stdlayout
> the "newproj" location I lose all of the revision history associated
> with "oldproj/trunk" that has been copied to newproj/trunk/oldproj.
> How can I have git understand the history for the
> newproj/trunk/oldproj location?
If I were in your situation I would do the following:
0. Make backups!
1. git svn init -Rnew ...newproj info...
2. Edit .git/config to put the new project in a separate
refs/remotes/newproj/ hierarchy.
3. git svn -Rnew fetch
4. gitk --all. Look around.
5. For each "tip" of the old history:
git replace <corresponding new commit> <old branch tip>
6. gitk --all. Make sure it looks right.
7. git filter-branch -- --all
8. rm -fr .git/svn. This is destructive, but only of information
you're probably not using. (It forgets old properties, for
example.)
9. Edit .git/config and use "git branch -r -d" to get rid of references
to oldproj. Rename the newproj svn-remote to "svn" again.
10. git svn fetch.
11. gitk --all. Everything good? Push.
> # An alternative would be if I could somehow reconfigure my already
> checked out oldproj git repo so I retain all of the version history
> and my local branches and can move forward checking code into the
> newproj/trunk/oldproj location?
If your history in each branch is not published and is linear, you
could also try just putting the old and new histories in one temporary
repo and rebasing your private branches.
Or you can export your own work with "git format-patch" or "git
fast-export" and reimport it with "git am" or "git fast-import".
Hope that helps,
Jonathan
next prev parent reply other threads:[~2010-10-04 18:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-04 18:36 git svn project shuffle Christopher Snapp
2010-10-04 18:54 ` Jonathan Nieder [this message]
2010-10-13 13:41 ` Christopher Snapp
2010-10-15 16:48 ` Jonathan Nieder
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101004185424.GA6343@burratino \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=snappca@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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).