Von Gast (nicht überprüft) , 29 April 2026

Tags als Release-Marker

Ein Git-Tag ist ein unveranderlicher Label auf einem Commit.

Tags erstellen

# Annotated
git tag -a v1.4.0 -m "Release 1.4.0"

# Signed
git tag -s v1.4.0 -m "Release 1.4.0"

# Lightweight
git tag v1.4.0-alpha

Tags pushen

git push origin v1.4.0
git push --tags
git push --follow-tags

CI bei Tags auslösen

on:
  push:
    tags:
      - 'v*.*.*'

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - run: npm run build
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

SemVer und Prereleases

if [[ "$TAG" =~ -(alpha|beta|rc) ]]; then
  npm publish --tag next
else
  npm publish
fi

Changelogs aus Tags generieren

git log v1.3.0..v1.4.0 --oneline --no-merges
npx conventional-changelog -p angular -i CHANGELOG.md -s

Tags auflisten und inspizieren

git tag
git tag -l 'v1.*'
git show v1.4.0
git tag --contains <sha>
git describe --tags HEAD

Tags loschen und verschieben

git tag -d v1.4.0
git push origin --delete v1.4.0
git tag -a v1.4.0 -m "Release 1.4.0" <new-sha>
git push origin v1.4.0