You have an existing local clone of a GitHub repository, with its complete commit history available. The remote origin points to that repository.
An approved hotfix has the unique commit subject Correct invoice rounding. You have not identified its commit ID. The current HEAD is a later, unapproved commit.
You must publish a lightweight tag named v1.4.1 for the approved hotfix. That tag does not exist locally or on GitHub. Several unrelated tags exist only locally and must remain unpublished.
Which actions should you perform, and in what order?
You didn't answer this one.
Correct invoice rounding in the local repository history and copy its commit ID.git tag v1.4.1 <commit-id>, replacing <commit-id> with the copied commit ID.git push origin v1.4.1.First identify the approved historical commit so that the tag points to the required hotfix. Create the local tag with that commit ID, then push the named tag to GitHub. Pushing all tags would also publish tags that the scenario requires you to keep local.
- Step 1: Find the commit with the subject
Correct invoice roundingin the local repository history and copy its commit ID. The target commit ID is unknown. Identifying it supplies the explicit target needed to tag the approved hotfix instead of the later HEAD commit. - Step 2: Run
git tag v1.4.1 <commit-id>, replacing<commit-id>with the copied commit ID. This creates the lightweight tag against the identified hotfix commit. It requires the commit ID obtained from the history. - Step 3: Run
git push origin v1.4.1. The local tag must exist before it can be pushed. Naming this tag explicitly publishes it without publishing the unrelated local tags. - Not needed: Run
git push origin --tags. This pushes all local tags, violating the requirement that the unrelated local tags remain unpublished.