cli / cli/cli

`gh release create`: Fetch tag if it was created by the API

Open
#7,629 1 comment 0 reactions 0 assignees View on GitHub
enhancement gh-release
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### Describe the feature or problem you’d like to solve

After using `gh release create` and creating a release that would generate a tag from the API, I noticed that the tag didn't exist locally.

### Proposed solution

Simply calling `git fetch --tags` would fetch all tags from the remote. Though, if you want to get specific, `git fetch REMOTE refs/tags/TAG:refs/tags/TAG` should work. This is a small convenience that allows the user to call `git log`, `git show TAG`, or another command to verify that the correct commit was tagged.

### Additional context

As stated previously, this is a small convenience, and a simple call to `git fetch` will pull down the tag created by the API.

Also, this should obviously only try to get the tag if it's run in the repository where the release is created, or a fork of that repository.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.