Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am planning to do two things on several large (several gigs) and old (several years) repositories:

  1. Move from bzr to git without losing the commit history.
  2. Restructure all the repositories either using bzr or git. This will involve moving files/directories from one repository to another with its change history.

Doing both at once would be foolish (I think!) but I am not sure which one should be done first. Any suggestions?

Anything I should watch out for when migrating/restructuring?

Note to those that voted to close: Can you leave a note as to how to improve the question? It would be nice and polite and helpful. It'll make a nice change.

share|improve this question
2  
Hum, I am not happy with how I phrased the question but cannot think of a better way to phrase it. All improvement suggestions are most welcome. – Sardathrion Nov 28 '12 at 8:26
I believe git filter-branch is one of very few tools out there that can split out part of a repository including it's history. – Jan Hudec Nov 28 '12 at 8:56
Close voter(s): Please could you leave a comment as to how to improve the question? Pretty please with sugar on top? – Sardathrion Nov 28 '12 at 9:20
@Jan Hudex: git filter-branch can do that, but only in a git repository. You can not use that for a bzr repository, which is the idea here. – martiert Nov 28 '12 at 9:57
1  
@martiert: No, here the question is whether to first convert to git or first restructure. So I am saying that git has a tool for it and I am not aware of such tool for bazaar. – Jan Hudec Nov 28 '12 at 10:06
show 4 more comments

closed as not a real question by gnat, Walter, Robert Harvey, ElYusubov, Ryathal Nov 30 '12 at 21:33

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

2 Answers

up vote 2 down vote accepted

What it sounds like to me, what you basically want is to change from bzr to git without loosing history(?)

You can watch this: http://librelist.com/browser//cville/2010/2/9/migrate-repository-bzr-to-git/

which is the easiest way of doing it. This will keep all of your commit history intact. Other than that, you will just have to push this up to your git remote, and of course get used to the git workflow.

If I have misunderstood you in any way, please say so, and I'll see if I can change my answer to what you actually want to know.

EDIT: As Jan Hudec said, git has a tool to get out a complete history with files/directories given a path in your repo.

git filter-branch

So you could/should first do your merging to git, then run git filter-branch to move files/directories between repositories.

share|improve this answer
As your question might be a bit confusing, perhaps you should edit your question to reflect this then? – martiert Nov 28 '12 at 9:58

Definitely convert first:

  • You want to do the restructuring in the new system to
    • learn it,
    • see how well it copes,
    • stop bothering about the old system already and
    • avoid complicating the conversion more than necessary.
  • Git's filter-branch is quite advanced and takes some thought to use, but I don't know any other tool that could split a repository to separate projects and keep relevant history in each of them.
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.