threads / discuss / 25286

Rebase with tags

Subject: Rebase with tags

## tl;dr

3 messages between Sep 29, 2010 and Sep 29, 2010.

replies: 2people: 3as markdown or json

Leonid Podolny· Sep 29, 2010, 08:45 UTC · lore

Hi, I would expect this question to be asked dozens of times already, but surprisingly I can't readily find an answer. Is it possible to transfer tags to a new branch during rebase? I mean, during the rebase process, when git applies a tagged commit, I want it to transfer a tag to a new commit. Is it possible, at least, to receive a set of (old commit, new commit) pairs, so that I will write a little script that will do that for me?

Jon Seymour· Sep 29, 2010, 11:43 UTC · re: Leonid Podolny · lore

Re: Rebase with tags

Sent from my iPhone
On 29/09/2010, at 18:45, Leonid Podolny <leonidp.lists@gmail.com> wrote:
> Hi,
> I would expect this question to be asked dozens of times already, but
> surprisingly I can't readily find an answer.
The reason this is not directly supported is that it encourages people to regard tags as mutable entities that can be changed at will. This goes against the general principle that a tag, once cut, never changes.
Technically you can change a tag, but this is meant to be a measure of last resort not something you do as a matter of course.
That said, I understand the requirement - if you are using tags as markers for different segments of a private history, I can see it would be useful to move the markers when you rebase. 
Perhaps there might be a case for a kind of marker reference that does move with a rebase, but it would be somewhat invasive to implement so you'd have to convince the list it was worthwhile.
jon.
Thomas Rast· Sep 29, 2010, 12:20 UTC · re: Leonid Podolny · lore

Re: Rebase with tags

Leonid Podolny wrote:
> Is it possible, at least, to receive a set of (old commit, new commit)
> pairs, so that I will write a little script that will do that for me?

The post-rewrite hook gets this list, so you can use that if you want to.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

← back to recent threads