Re: git push tags
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Oct 28, 2012, 18:15 UTC
- Message-ID
- <508D7628.10509@kdbg.org>
- In-Reply-To
- <CAB9Jk9DMOwhDf3SvMzTmTZiyZg_4pgXx-evrfWkB3U4w-KqtVw@mail.gmail.com>
Am 25.10.2012 08:58, schrieb Angelo Borsotti:
Show 18 quoted lines
> Hello, > > git push tag updates silently the specified tag. E.g. > > git init --bare release.git > git clone release.git integrator > cd integrator > git branch -avv > touch f1; git add f1; git commit -m A > git tag v1 > git push origin tag v1 > touch f2; git add f2; git commit -m B > git tag -f v1 > git push origin tag v1 > > the second git push updates the tag in the remote repository. This is > somehow counterintuitive because tags normally do not move (unless > forced to that), and is not documented.
Tags are refs, just like branches. "Tags don't move" is just a convention, and git doesn't even respect it (except possibly in one place[1]). You can't reseat tags unless you use -f, which is exactly the same with branches, which you can't reseat unless you use -f.
[1] By default, git fetch does not fetch tags that it already has.
> This is also harmful because it allows to change silently something > (tags) that normally must not change.
You asked git push to push a tag, and the tag was pushed. What's wrong?
-- Hannes