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 [email protected]:mycompany/project/repo.git
! [remote rejected] fullhistory -> fullhistory (n/a (unpacker error))
error: failed to push some refs to '[email protected]:mycompany/project/repo.git'
fullhistory
branch does not have common revisions with existing master in new repo, because I can successfully push the same branch to old repo where it originates from. – Fluoroscope