A bit of context: I recently migrated from CVS to Git using cvsimport. There is now a common (bare) repository, managed by gitolite, where people push their local changes. I then discovered that many tags from the old CVS history were not perfectly imported. I could fix that by re-doing the migration from CVS using cvs2git (locally), and grafted the branches' heads of my first repo onto the new tree given by cvs2git (still locally). I now have a complete tree with a nicer history than before, where the heads of all the branches have the same hash as what is currently on the remote (I used grafts and filter-branch, as in this answer: https://stackoverflow.com/a/2428339/1005470)
What I would now like to do is to push those changes to the remote. Of course, git push
returns that everything is up-to-date: I don't know how to push a re-written history.
Because the refs match, git push -f
also returns that everything is up-to-date.
Moreover, I would of course like that other developers barely notice that something has changed. They should just see an updated history next time they pull (I'm also OK if they have to re-clone). I am assuming that they have not based any work on commits prior to the branches' heads (I am aware that it would otherwise be a big mess).
Edit: to clarify, here is (an extract of) the output of git rev-list HEAD
on both repositories. The commit in bold is the point where I did the graft. I would like to overwrite everything below that point in the remote by what I have in the local repository.
Local repo:
fff881c238fff8b0057be8dab494ec5a6aa181d9
ac513b5596cca48dd885a969fdcc4a2b49e507d0
1b199d8e4ac29e4bd39ff96059031cf9b1390609
427837c98a14f28bc2e5d91fcf89e954b3bb3e77
0d9e58cc4f6a0107c718c689e24353d4ce59ab8c
....Remote repo:
6ad634da6e5acda43e6cf0919e8f4994c08ac862
bd32b7c9b0ae4faea51720b98586f89972b52e58
3778ce4ff85f269e2287d57c7aec3ecefabc135a
d3c343f3498d1d82b680be2ffc2c5e05c14a3d4c
a5d200b99f31a005cc8312d0a23a79d4014a2156
8b90afbbb06bea062d26b520c42c068ef96e5db7
fff881c238fff8b0057be8dab494ec5a6aa181d9
19cf091efb12413027941ac893ea8d503fea415e
efbed577d5986beef45ba0f9a2560f4b1ca120fc
bbec686e3389abe0679672a3d71c236b98ffc111
5b56665e48b3af51a25d0c9d2342d04e730aaa16
2ce095b0ed92f22baf74e728bda07bfded5a4e7b
...