I have a project where I've merged in a library using Git subtree. I've pushed and pulled a few minor changes between the library and the project.
Later on, a new repository has been created which is the definitive home for the library. It contains essentially the same version of the library code as my project did, with perhaps one or two minor changes. For various reasons, it doesn't share any direct Git history with the previous home of the library (it is not a clone of the previous library).
What I want to do now is change my project so that it pulls/pushes the library from the new location. The first time this happens I also need to resolve any merge conflicts, although in this case the changes are trivial and they could just be redone later.
What is the best way to do this?
I tried deleting taking a copy of the the library in my project, then removing it along with the old remotes and branches. I then tried doing subtree add etc from the new location. This seemed to work, but when I try to push back from my project to the library I'm getting a fatal bad object error.
I assume that there's a flaw in the approach that I've tried - probably to do with the lack of a shared history - but I don't quite have a deep enough understanding of what's going on to know how to fix it, or what the "proper" approach to this problem should be.
[update: edited the question to make it slightly clearer - it was a bit ambiguous]