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

  • Home
  • SEARCH
  • 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 8803633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:23:19+00:00 2026-06-14T01:23:19+00:00

I have a situation where I have two repository histories that have been duplicated

  • 0

I have a situation where I have two repository histories that have been duplicated and mangled (via interaction and migration around SVN–not my choice). I have both repositories as remotes in the same temporary maintenance repository. They share a few hundred commits worth of history, and then the “old” one continues for a few dozen more on a few branches. I need to fast-forward the “new” tree up to the state of the old one. Because of the mangling however, despite having identical content, they are not recognised as the same tree.

I would like a way to tell git “These two commits are identical, despite having different authors” (author ID was confused in translation). If possible, I would then really like if it could traverse the two remote trees and make that association for every node with identical content. This would mean I could then manually mark “commit 1” on both, and have it do the rest. Otherwise I would need to manually mark the root of every divergence (wouldn’t be too bad, but would prefer not to).

I tried using graft points, which is nearly what I want– gitk shows what I want, but when I pushed it back to the main (new) repository, it dragged along the couple-hundred duplicate commits. It’s also a bit annoying to do, since I have to do it for a not-yet-merged child node.

I found https://stackoverflow.com/a/973403/372757 , and think that it will work: I will merely need to rebase the old commits onto the new repository, once for each branch.

None the less, I would still like to know if my original request is possible.

  • 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-14T01:23:20+00:00Added an answer on June 14, 2026 at 1:23 am

    git has a pretty strict definition of what an “identical commit” would be, that probably doesn’t match what you’re thinking. In order to be an identical commit, all of the following must be true:

    1. every file in the tree to be committed must be byte-for-byte identical to the same file in the commit that will become the parent of the new commit (i.e. the current HEAD)
    2. no new files, no removed files, no reorganization – the tree must match exactly, since the SHA1 of a tree depends on the files and subtrees it contains; if any leaf on the tree is different, the SHA1 of the top-level tree will be different
    3. exactly the same author and committer name and email values
    4. exactly the same author and commit dates
    5. exactly the same current value of HEAD, which becomes the parent of the new commit
    6. exactly the same commit message
    7. possibly a couple other details that I’m missing

    All of these things are either directly or indirectly used in generating the SHA1 hash for the new commit, and thus a commit won’t be identical unless it’s truly identical.

    That said, and I think possibly more to the point of your question, when generating a new commit, if a particular file or tree is byte-for-byte identical to what an object that is already in the database, because another commit had those things in exactly the same state, then the new commit will point to those already existing objects – they won’t be stored again.

    If it’s only author information that differs in two branches (which will be a different sequence of commits, even if the file contents matched entirely with another branch), you can use git filter-branch or git rebase to rewrite a branch, fixing the information as you go, but that will result in a whole new set of commits (but all the trees and file objects can potentially stay the same, assuming you don’t change anything other than commit messages, times, or author/committer names). Note however, that if other work (by yourself or others) is already based off the existing branch, there can be a significant amount of cleanup involved in making such changes.

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

Sidebar

Related Questions

I have a situation where I want to connect two tables that do not
I have two machines, A and B that both access an external hg repository.
I have a situation that requires two SQL Compact edition databases to synchronise with
I have a situation where two separate companies wish to 'join' their iOS apps
I have a situation where two objects of the same type have parents of
In this situation I have two models, Comment and Score. The relationship is defined
I have a situation where I need to pass two parameters to an action.
I have the situation where i have two databases with same structure. The first
this is my situation: I have two org.w3c.dom.Document created from two xml files. What
We have a situation where we are trying to add two UITableViews inside a

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.