brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: push.followTags sends your release tags along with git push

Git
~/tips/tip-git-push-follow-tags

git config --global push.followTags true

Pushes annotated tags on the commits you push, so release tags never stay local.

A plain git push doesn’t send tags. It’s easy to tag a release, push, and then wonder why the server never got the tag.

git config --global push.followTags true

With this setting, every git push also pushes annotated tags that point at commits you’re pushing and that the server doesn’t have yet. You’ll see a line like * [new tag] v9.0 -> v9.0 in the output. It’s the same as adding --follow-tags each time.

The difference from git push --tags matters. That one pushes every tag you have locally, including old experiments and tags you never meant to share. Follow tags is selective: only annotated tags, and only those on commits you’re pushing.

So I’d tag releases with a message, which makes them annotated:

git tag -a v2.1.0 -m "Release 2.1.0"
git push

Lightweight tags, made with a plain git tag v2.1.0, are skipped by this setting on purpose. That can be surprising at first, but it means a quick local bookmark stays local. To share one anyway, push it by name: git push origin v2.1.0. And tags on commits that are already on the server won’t go along either, since you aren’t pushing those commits.

Further reading: git-push documentation, git-config documentation

Going deeper: Guide: advanced tmux, a config that grows with you, formats, layouts and more

More Git tips git show-branch main feature git log --stat -5 git merge --no-ff feature -m "Merge feature" git merge --squash feature git merge --abort All Git tips (144) All topics

Link