views:

45

answers:

1

edit The question boils down to "Can git rebase be instructed to rebase tags, too?" But an answer to the original question would also help.


Asking How to prepend the past to a git repository? I followed these instructions. <edit>Then I rebased to include a file that was only in the snapshots, see here.&lt;/edit> Since history was rewritten (by git filter-branch or git rebase or both?) all tags are still on the original time line* and I'd somehow like to move them to the new one. I think I made all commit-messages with tags unique so I could try writing a script that uses them, but a more general git move-tags <from> <to> would be better.

So, is there a way to address "the commit which is N commits after on the new timeline such that the Nth commit after on the old timeline is tagged "? Any other solution except the obvious manual retagging would also be great.

(please feel free to correct that horribly long sentence into plain English...)

*) hey, git solved the grandfather-paradox!

+1  A: 

There is no built in way to do what you want using git. 'git rebase --tags' might be interesting but it does not exist.

If the commit messages are identical as you say then you could go through each tag in refs/tags, do:

'git log -1 --pretty=oneline <tagname>'

Compare the commit message to the full list:

'git log --pretty=oneline <newbranches>'

If you find a match (and the SHA1 hash is different) then do:

'git tag --force <new SHA1> <tagname>'
Frosty