Move to git and bzr branches

Asked by Jared Silva

Kevin, great work.

I think the move from bzr to git is orphaning the bzr branches. Please see https://answers.launchpad.net/bzr/+question/199401, change parent location and be able to merge, for more detail.

Is it possible to keep lp:~kevin-mehall/pithos/trunk up to date against ~kevin-mehall/pithos/git-import?

Question information

Language:
English Edit question
Status:
Solved
For:
Pithos Edit question
Assignee:
No assignee Edit question
Solved by:
Kevin Mehall
Solved:
Last query:
Last reply:
Revision history for this message
Jared Silva (jayrod) said :
#1

Hmm, if I cannot technically do this, you probably cannot either.

Do you know if it is possible to convert my bzr branch to git and then track against your git branch without losing my branch history?

Revision history for this message
Best Kevin Mehall (kevin-mehall) said :
#2

Sorry to break your branch. Launchpad's git importer creates a whole new branch; it wouldn't add on top of the old one.

Git commit ids are content hashes, so if you run another export+import, you'll get the same content hashes and a mergeable branch

Try:
git clone git://github.com/kevinmehall/pithos.git pithos-git
cd pithos-git
bzr fast-export <path to your bzr repo> | git fast-import --force # overwrite the branch with the import
git reset --hard HEAD # Update the checkout to match the commit
git rebase origin/master # and replay your changes on top of all the subsequent changes in git

If you want to stay with bzr, there's the rewrite plugin, which is kind of like git rebase. Git rebase with the --onto option would allow you to merge when the history is totally separate, and it looks like bzr has that option too. You'd need to use the commit id hashes to specify the commit that's identical on both branches, and then it will replay the following commits onto the new branch.

Revision history for this message
Jared Silva (jayrod) said :
#3

Git works. I tried similar for bzr and could not get it to succeed. I will track pithos using git. Thanks for the help.

Revision history for this message
Jared Silva (jayrod) said :
#4

Thanks Kevin Mehall, that solved my question.