I cut the history of my master
branch into an old_stuff
branch, via the advice of this Q&A: How do I remove the old history from a git repository? . To save you a click-through, the process involves grafting the last commit of master
to the root commit, effectively giving it no parent, then using git filter-branch
to make that change permanent. My local repository is now how it should be, with a short master
branch and a long history branch.
But if I git clone
the repository, that commit that shouldn't have a parent has the same parent as before. When I do git push -f origin master
, I wind up with a master
branch with the newly created commit at its head, but with a parent of the prior commit to master
. So now I have a long old_stuff
branch and a master
branch that is as long plus one commit. If it's relevant, the remote is on Github.
How do I tell the remote repository and other copies to revise the parent for the new commit?
PS: I've read the warnings about how changing the history at a shared repository breaks other people's copies. I know the names of the people involved and can ask them to accommodate, so I'm comfortable revising the branch history in this current case.