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 8865909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:38:42+00:00 2026-06-14T16:38:42+00:00

I need to know the proper way to move git history from one repository

  • 0

I need to know the proper way to move git history from one repository to another on codebasehq.com. Situation:

  • there is a repo on codebasehq.com which I call “old” on path like mycompany.codebasehq.com/projects/OLDNAME/repositories/PROJECTNAME
  • after some development in old repo the team realized that this repo should actually be in different location on codebasehq.com and did “new” repo with just files from “old” repo and push it to mycompany.codebasehq.com/projects/NEWNAME/repositories/PROJECTNAME. So new repo right now has only one (initial) commit with all files from old repo but no old history at all.

I want to bring back history from old repo to new repo. I’ve read about rebase and graft here: How to rebase one Git repository onto another one? and I was able to successfully graft two repositories into one.

What I need to know is how to replace this new repo with 1 initial commit by rebased/grafted repo with all old history included. Should I delete this wrong new repo and re-create it from scratch or just push with some special flags to it?

UPD: I’ve tried to just push branch with full history (old+new) to mycompany.codebasehq.com/projects/NEWNAME/repositories/PROJECTNAME as new branch named fullhistory but got error:

bash-3.2$ git push codebasehq fullhistory
Counting objects: 104, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (74/74), done.
Writing objects: 100% (74/74), 1.74 MiB, done.
Total 74 (delta 36), reused 5 (delta 0)
fatal: unresolved deltas left after unpacking
error: unpack failed: unpack-objects abnormal exit
To git@codebasehq.com:mycompany/project/repo.git
 ! [remote rejected] fullhistory -> fullhistory (n/a (unpacker error))
error: failed to push some refs to 'git@codebasehq.com:mycompany/project/repo.git'
  • 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-14T16:38:43+00:00Added an answer on June 14, 2026 at 4:38 pm

    You could try the following:

    • git clone OLDREPO
    • git remote add new NEWREPO
    • git fetch new

    Your old history should now be in master while your new history is in new/master

    • git checkout new/master
    • git rebase -i master

    This will start an interactive rebase that transplants everything from new/master onto master. Since you probably want to drop the first commit from your new code (the one that was a simple copy of the work at that time) you should delete the according line in the editor that will be shown to you. The rest should be set to pick.

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

Sidebar

Related Questions

I need to know the proper way of doing this. I have a form
I need to know how to exclude files/folders from php generated zip. Here is
Is there a proper way to display text at the descent height of a
Is there a way to start an activity from a view? I have this
I just want to know how the proper way of doing 2 way connection
Does anyone know the proper way to query azure table storage for a null
I have a newbie question about Git: I need to move back and forth
I am curious about the proper way to stop a user from activating my
I would like to ask, what is a proper way to select books from
Need to know this so that i could send DTMF and that is going

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.