Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9140343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:30:15+00:00 2026-06-17T09:30:15+00:00

I imported a Bazaar repository into Git (using git bzr ), but the resulting

  • 0

I imported a Bazaar repository into Git (using git bzr), but the resulting repository contains a spurious commit parent link:

Spurious parent link

Notice that the commit tagged 1.02-6 is based off the 1.02-3 commit, but 1.02-1 is unnecessarily also marked as a parent. (Note: All the commits in this part of the repo are tagged; there are no commits between the ones shown.)

I have tried rebasing in several ways (on the master branch: git rebase 1.02-3, git rebase -i upstream-1.02, git rebase --onto 1.02-1 1.02-3, git rebase --root upstream-1.02 --onto=other_branch), but in each case it fails with a merge conflict. These seem to be attempting more than is necessary; the history is correct except for an extra parent pointer being recorded in the commit tagged 1.02-6.

How do you remove the link in order to linearize the history? Is there a better way than manually cherry-picking all the commits in sequence?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:30:15+00:00Added an answer on June 17, 2026 at 9:30 am

    You can do it manually using the git commit-tree internal command.

    We want to edit the commit tagged 1.02-6 to remove the spurious parent pointer (to 56a2f3b5948ab54c9239c2b384a6ea9eb1f410c4).

    First, read the information from the existing commit object:

    user@host:/path/repo.git$ git cat-file -p 1.02-6 
    tree c658aa1ebcf2bf2a607696c7868b875be72fb01f
    parent 56a2f3b5948ab54c9239c2b384a6ea9eb1f410c4
    parent 4e671bf1d2298729c9e5cfd8229051cfe2c40831
    author James Damour (Suvarov454) <suvarov454@users.sourceforge.net> 1146319620 -0400
    committer Bazaar Package Importer <james.westby@ubuntu.com> 1146319620 -0400
    
    The "main/" in the Section line of debian/control should be assumed.
    

    Extract the commit message using git log --format=%B -n 1 1.02-6.

    Now create a new commit with the same content (excluding the spurious parent link, and the committer info):

    git log --format=%B -n 1 1.02-6 | \
        GIT_AUTHOR_NAME="James Damour (Suvarov454)" \
        GIT_AUTHOR_EMAIL="suvarov454@users.sourceforge.net" \
        GIT_AUTHOR_DATE="1146319620 -0400" \
        git commit-tree c658aa1ebcf2bf2a607696c7868b875be72fb01f \
            -p 4e671bf1d2298729c9e5cfd8229051cfe2c40831
    

    This created a new commit, and printed its hash (cc32e66…). Now turn it into a new branch:

    git checkout -b fixed_commit cc32e66
    

    and rebase master onto the new branch:

    git checkout master
    git rebase fixed_commit
    

    And we’re done:

    Finished

    You probably want to delete the old branches and re-tag the appropriate commits.


    Actually it might be easier to use git filter-branch --parent-filter. I haven’t tried that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I imported system.web into my class lib project. Trying to find: system.web.httpserverutility.server.mappath But I
I imported an excel file into my database using Tasks -> Import -> Excel
I have imported a plain-text version of PDF using a Python script, but it
I imported data from csv files into a MySQL database, but made the mistake
I imported external libraries using absolute path. But I have two work environments, switching
I tried to list imported DLL of PE file using following code, but it
Imported into a MySQL table is a report that contains a user generated field
I imported a resource (resource being a GZIP file) into my Java project, but
I imported data from MS-Access into a SQL database using the import/export wizard. Now,
I imported a table from a CSV file into MySQL using this query: LOAD

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.