Add --force to git fetch --tags command #1357
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a repository periodically generate GitHub tags using GitHub Actions, they will run into this command failing with the exit code 1. This error seems to happen if remote tags have changed from the local tags. Adding
--force
allows overwriting of the local tags with the remote ones.Before Git 2.20 (released Dec 2018), --force used to be implicit when using
git fetch --tags
.Some reference posts:
https://bobcares.com/blog/git-fetch-failed-with-exit-code-1/#:~:text=In%20short%2C%20we%20can%20fix,its%20properness%20in%20case%20sensitivity.
semantic-release/git#136