All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthias Fechner <idefix@fechner.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: git@vger.kernel.org, Alexey Shumkin <alex.crezoff@gmail.com>
Subject: Re: Switch from svn to git and modify repo completely
Date: Sun, 27 Nov 2011 11:56:22 +0100	[thread overview]
Message-ID: <4ED21756.70705@fechner.net> (raw)
In-Reply-To: <20111121070247.GA16708@elie.hsd1.il.comcast.net>

Am 21.11.2011 08:02, schrieb Jonathan Nieder:
> The section "CHECKLIST FOR SHRINKING A REPOSITORY" from the
> git-filter-branch(1) manual page has some hints.  In particular, "git
> clone --no-hardlinks" still _copies_ all objects --- you probably
> would want "git clone file://$(pwd)/repo-orig" to make sure the
> ordinary transfer negotiation kicks in.
> 
> It's very important that the documentation not be misleading, so if
> you can point to places where the wording can be less confusing, that
> would be very welcome.

it would be fantastic if exactly this information is noted in the
manual. For me it is not really clear what is the difference between a
git clone with and without --no-hardlinks.

I was now able to convert my svn repo to a git repo and split the new
git repo in several different ones, including the complete history.

Here a short summary for all how need to do the same.
At first convert the svn into a git reposity:
git svn clone file:///path/to/svn -A authors -s gitrepo.git

To create the authors file, check the man page.

To get a list of all files:
git show --pretty="format:" --name-only startrev..endrev | sort | uniq

Maybe you want to remove some branches from the repo because svn users
used it in a completely wrong way:
git branch -rd badbranch

Now clone the repo and remove files from it you do not want anymore:
git clone gitrepo.git tofilter.git
cd tofilter.git
git filter-branch -f --tree-filter 'rm -Rf file1 file2.bla dir1 \
projekt1/dir2' --prune-empty -- --all
git gc
cd ..

Repeat this step for all combination you need.

Now create a bare repository and enable some options to use it as a
central repo:
git clone --bare tofilter.git tofilter_bare.git
cd tofilter_bare.git
git config core.sharedRepository 1
git config receive.denyNonFastForwards true
git gc
cd ..

Now you can copy the repo to the target server/directory and clone it
from there.

Bye
Matthias

-- 

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning." --
Rich Cook

  reply	other threads:[~2011-11-27 10:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-19 17:11 Switch from svn to git and modify repo completely Matthias Fechner
2011-11-19 18:50 ` Alexey Shumkin
2011-11-20 22:21   ` Matthias Fechner
2011-11-21  7:02     ` Jonathan Nieder
2011-11-27 10:56       ` Matthias Fechner [this message]
2011-11-28 10:10         ` Matthias Fechner

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=4ED21756.70705@fechner.net \
    --to=idefix@fechner.net \
    --cc=alex.crezoff@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@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 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.