Skip to content

Change push command option to use --follow-tags instead of --tags - #194

Open
NotFounds wants to merge 1 commit into
changesets:mainfrom
NotFounds:change-push-option
Open

Change push command option to use --follow-tags instead of --tags#194
NotFounds wants to merge 1 commit into
changesets:mainfrom
NotFounds:change-push-option

Conversation

@NotFounds

Copy link
Copy Markdown

There's no necessary to push all tags in refs/tags. It's enough to push only lacking tags from the remote.
So we can use --follow-tags option instead of --tags.
cf. https://git-scm.com/docs/git-push#Documentation/git-push.txt---follow-tags

Push all the refs that would be pushed without this option, and also push annotated tags in refs/tags that are missing from the remote but are pointing at commit-ish that are reachable from the refs being pushed.

It can prevent failing workflow with the following exception: hint: Updates were rejected because the tag already exists in the remote.

@changeset-bot

changeset-bot Bot commented Jun 30, 2022

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4aab3b1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@changesets/action Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Andarist

Copy link
Copy Markdown
Member

It can prevent failing workflow with the following exception: hint: Updates were rejected because the tag already exists in the remote.

How that has happened to you though? If I tree to git push --tags in a repo full of tags I just get back this:

Everything up-to-date

I assume that the remote tag was pointing to a different commit than your local one and it seems that it's a sign of some problem in your scripts somewhere.


I think that I'm OK with changing this command but there is, of course, a slight difference there and it can bite some less conventional setups (hopefully it wouldn't affect any though). @mitchellhamilton WDYT?

@NotFounds

Copy link
Copy Markdown
Author

How that has happened to you though? If I tree to git push --tags in a repo full of tags I just get back this:

Everything up-to-date

Thank you for your comment. I'll re-check my script and what is happened there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants